Created
August 13, 2020 16:16
-
-
Save caiaffa/8ece1642abc05cb59d1260ce6fa6fa23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$qb = $this->createQueryBuilder('p'); | |
$qb | |
->select('partial p.{id, name}, partial pmmp.{id}') | |
->leftJoin('p.contractsRenovation', 'pmmp') | |
->where('p.id = :productId') | |
->setParameter('productId', $productId); | |
return $qb->getQuery()->getResult(Query::HYDRATE_ARRAY); | |
$qb = $this->createQueryBuilder('p'); | |
$qb | |
->select('p', 'pmmp') | |
->leftJoin('p.contractsRenovation', 'pmmp') | |
->where('p.id = :productId') | |
->setParameter('productId', $productId); | |
return $qb->getQuery()->getResult(Query::HYDRATE_OBJECT); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment