Doctrine criteria - filtering collections
where($Expression) |
Replaces previous statement |
[and/or]Where($Expression) |
Adds AND /OR where statement |
orderBy($array) |
Sets OrderBy |
setFirstResult($firstResult) |
Sets first result |
setMaxResult($max) |
Sets Maximum results |
$userCollection = $group->getUsers();
$criteria = Criteria::create()
->where(Criteria::expr()->eq("birthday", "1982-02-17"))
->orderBy(array("username" => Criteria::ASC))
->setFirstResult(0)
->setMaxResults(20)
;
$birthdayUsers = $userCollection->matching($criteria);
$criteria = Criteria::create()
->where(Criteria::expr()->eq("birthday", "1982-02-17"))
->orderBy(array("username" => Criteria::ASC))
->setFirstResult(0)
->setMaxResults(20)
;
$birthdayUsers = $userCollection->matching($criteria);
Comments
Related