Does Phalcon's ODM support between finds?
I am trying to get a list of objects based on their dates. So i need to be able to look for dates between X and Y.
I could Do > and < or i could use Betwen. I don't really care which one, but i can't seem to get either to work.
$beginDate = "2015-01-01 00:00:00";
$endDate = "2015-02-01 00:00:00";
Model::find(array(
'conditions' => array(
'userId' => $user->id,
'signDate >' => $beginDate,
'signDate <' => $endDate
)
));
Now obviously this is not using the sql Between function. I would much prefer something liek this.
$beginDate = "2015-01-01 00:00:00";
$endDate = "2015-02-01 00:00:00";
Model::find(array(
'conditions' => array(
'userId' => $user->id,
'signDate >' => array(
'between' => array(
$beginDate,
$endDate
)
)
)
));
This is what i am looking for on the sql select side.
SELECT * FROM model WHERE userId = '{$user->id}' AND signDate BETWEEN '{$beginDate}' AND '{$endDate}'