1

Similiar to Logical OR in doctrine2 getRepository->findBy() but no duplicate.

Duplicate of doctrine2 findby two columns OR condition but I am asking for a findBy -way without the QueryBuilder.

SELECT * from table where CUSTOMER = value1 or SHOP = value2

This builds the WHERE condition with an AND

$em->getRepository('myentitity')
       ->findBy(
           array('CUSTOMER' => 'value1', 'SHOP'=>'value2'),
         );

How to get findBy results with OR ?

Important: The number of fields is not the same on every request.

Community
  • 1
  • 1
Daniel W.
  • 31,164
  • 13
  • 93
  • 151

0 Answers0