Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

doctrine querybuilder select alias

$qb = $entityManager->createQueryBuilder();

$qb->select('assoc1.thing as thing1, assoc2.thing as thing2')
    ->from(assoc1::class, 'assoc1')
    ->innerJoin(assoc2::class, 'assoc2', 'with', 'assoc1.someId = assoc2.someId')
    ->getQuery()
    ->getResult();
 
PREVIOUS NEXT
Tagged: #doctrine #querybuilder #select #alias
ADD COMMENT
Topic
Name
7+2 =