Last active
August 29, 2015 14:03
-
-
Save newage/4937b014b4fbc8a4cbf4 to your computer and use it in GitHub Desktop.
Add predicate to where with identifier and credential expressions in ZF2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$adapter = $this->getAdapter(); | |
$platform = $adapter->getPlatform(); | |
$predicateIn = 'DATE('.$platform->quoteIdentifierChain(array('dt_created')).')'; | |
$predicateIn .= " IN ("; | |
$predicateIn .= $platform->quoteValueList($days); | |
$predicateIn .= ")"; | |
$select->where(array($predicateIn)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For example
WHERE DATE(date_field) IN ('2003-12-31', '2013-10-20')