In my Dymfony2 / Doctrine2 application, I have oneToMany relationship between an object and its children.
I want to select all objects that have no children.
I am stuck with various errors: SingleValuedAssociationField is expected, Cannot add Having sth for a variable with no result, etc.
$queryBuilder = $this
->createQueryBuilder('object')
->leftJoin('object.children', 'children')
->andWhere('children IS NULL')
->getQuery()
->getResult();
How can i solve this?
source
share