Related to this answer on how to check for the (non)existance of related entities using Doctrine's is empty query, I try to use this within a Doctrine Expression, but the Expr Class has no documented way to use is empty. isNull doesn't work. So what I am looking for is an Expression like:
// filter for e with no relatedEntities
$qb->expr()->isEmpty('e.realatedEntities');
// filter for e with relatedEntities
$qb->expr()->isNotEmpty('e.realatedEntities');
So any ideas on this?
Doctrine's SIZE also has also no equivalent in the Expr-Class. Am I missing something? For now, I manipulate the query object instead of returning an expression (in Lexik form filter bindle for Symfony), but this is only a workaround.