How to create composite Criteria condition?

40 views
Skip to first unread message

Roman Gushel

unread,
Nov 3, 2013, 9:07:51 AM11/3/13
to yiimong...@googlegroups.com
I try to create search criateria with condition like this:
$date_start = new MongoDate(strtotime(date("Y-m-d") . " 00:00:00"));
$date_end = new MongoDate(strtotime(date("Y-m-d") . " 23:59:59"));
$conditions = $criteria->getConditions();
$conditions["creationDateTime"] = array('greaterEq' => $date_start, 'lessEq' => $date_end);
...
$criteria->setConditions($conditions);
But it doesn`t work correctly. In general, can I set date range (or other range) by using YiiMongoDbSuite?
Reply all
Reply to author
Forward
0 new messages