Is it possible to use OR
statement in Doctrine findBy()
method?
I know that given array is interpreted as case1 AND case2...
Like this
I know that this is old question. Anyways, it's possible to use Criteria
for the complex queries (in Doctrine 2 at least):
$criteria = new \Doctrine\Common\Collections\Criteria();
$criteria
->orWhere($criteria->expr()->contains('domains', 'a'))
->orWhere($criteria->expr()->contains('domains', 'b'));
$groups = $em
->getRepository('Group')
->matching($criteria);