Skip to content

Instantly share code, notes, and snippets.

@pvankouteren
Created January 25, 2017 10:14
Show Gist options
  • Save pvankouteren/3f673b8c8ca5f95f059e9290995aaf1d to your computer and use it in GitHub Desktop.
Save pvankouteren/3f673b8c8ca5f95f059e9290995aaf1d to your computer and use it in GitHub Desktop.
$contractObjectCollection = ContractQuery::create()
->filterByOrderId($this->getID())
->condition('contractToAfterNow', 'Contract.ContractTo > ?', date('Y-m-d'))
->condition('contractToIsNul', 'Contract.ContractTo = ?', '0000-00-00')
->combine(array('contractToAfterNow', 'contractToIsNul'), 'or', 'contractToCondition')
->condition('contractFromIsFilledIn', 'Contract.ContractFrom <= ?', date('Y-m-d'))
->combine(array('contractToCondition', 'contractFromIsFilledIn'))
->orderByContractFrom('asc')
->orderByContractId('asc')
->find();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment