SQL/Doctrine: getResult in leftJoin returns object and referenced object as 2 entries in array
问题 I've got the following problem in a Symfony2/Doctrine-Environment: A class a has a relation with class b, however this relation is not registered through ORM annotations or anything else, because the referenced table is variable. So I join in the following way: $query = $this->createQueryBuilder('a') ->select('a') ->addSelect('b') ->leftJoin('My\Bundle\EntityBundle\Entity\OtherClass','b',\Doctrine\ORM\Query\Expr\Join::WITH,'a.referenceId=b.id') ->getQuery()->getResult($hydrationMode); The