I am trying to do something similar to this SQL
in DQL
:
SELECT * FROM TBL
WHERE (something = foo AND something2 = foo2)
OR (something3 = foo3 AND something4 = foo4)
I got this that seems to work but I am seriously doubting it; what do you think ?
->where('something = :foo')
->setParameter('foo', $fooValue)
->andWhere('something2 = :foo2')
->setParameter('foo2', $fooValue2)
->orWhere('something3 = :foo3')
->setParameter('foo3', $fooValue3)
->andWhere('something4 = :foo4')
->setParameter('foo4', $fooValue4)
->getQuery()
->getArrayResult()