The phpcr odm documentation seems to be quite clear on that point, but I can't manage to make it. Here the raw mysql equivalent expected:
SELECT (foo, bar, baz) FROM table
WHERE (foo = 'foo') AND bar = 'bar' OR (baz = 'baz' OR baz = 'bazinga')
I tried something like this.
$qb->from()
->document('Detours\MainBundle\Document\Product', 'p');
$qb->where()
->andX()
->eq()
->field('p.foo')
->literal('foo');
$qb->andWhere()
->eq()
->field('p.bar')
->literal('bar')
->end();
$qb->where()
->eq()
->field('p.baz')
->literal('baz');
$qb->orWhere()
->eq()
->field('p.baz')
->literal('baz');