What is difference between
In application 1 / 2:
$qb = $this->createQueryBuilder('tu');
$transUnits = $qb->select('tu, te')
->leftJoin('tu.translations', 'te')
->andWhere($qb->expr()->in('tu.id', $ids))
->andWhere($qb->expr()->in('te.locale', $locales))
->orderBy(sprintf('tu.%s', $sortColumn), $order)
->getQuery()
->getArrayResult();
and
$qb = $this->createQueryBuilder('tu');
$transUnits = $qb->select('tu, te')
->leftJoin('AppBundle:Translation', 'te')
->andWhere($qb->expr()->in('tu.id', $ids))
->andWhere($qb->expr()->in('te.locale', $locales))
->orderBy(sprintf('tu.%s', $sortColumn), $order)
->getQuery()
->getArrayResult();
The functions are called with the exact same parameters.
In the second case I replace 'tu.translations' with 'AppBundle:Translation' because do not recognize 'translations' where translations is define:
<one-to-many field="translations" target-entity="TranslationBundle\Entity\Translation" mapped-by="transUnit">
<cascade>
<cascade-all/>
</cascade>
</one-to-many>
In the first case result is: array(13) { ... } and this is the correct format result; in the second case wrong format result is: array(70) { ... }