Details
Description
I have the next query:
$qb = $this->_em->createQueryBuilder();
$qb ->select('Inventory')
->from('\Entity\Inventory', 'Inventory')
->leftJoin('Inventory.Variant', 'Variant')
->where('(Variant.isSellable = 0) OR (Variant IS NULL)')
->getQuery()->getResult();
that throws an exception:
PHP Fatal error: Call to undefined method Doctrine\ORM\Query\AST\ConditionalExpression::isSimpleConditionalExpression() .../Doctrine/ORM/Query/SqlWalker.php on line 1378.
The SqlWalker::walkConditionalPrimary function expects the $primary parameter passed to it to be an instance of Doctrine\ORM\Query\AST\ConditionalPrimary, but it is actually an instance of Doctrine\ORM\Query\AST\ConditionalExpression class that is passed in that case and of course it does not have a method called isSimpleConditionalExpression.
The workaround is to use extra parentheses around the conditions: ((Variant.isSellable = 0) OR (Variant IS NULL)) which does not seem to be very intuitive way.
Fixed formatting, scheduled for 2.0.5