The way below works correctly:
$qb->select('partial t.{id,nsu,status,message}, partial u.{id,shortName,email} as user')
->from('GatewayBundle:Transaction', 't')
->join('GatewayBundle:User', 'u')
->where('u.id = t.user');
When I add another join
, it results in a syntax error:
ERROR - [Syntax Error] line 0, col 461: Error: Expected Literal, got 'JOIN' 500 Internal Server Error - QueryException
$qb->select('partial t.{id,nsu,status,message}, partial u.{id,shortName,email} as user, partial p.{id} as partner')
->from('GatewayBundle:Transaction', 't')
->join('GatewayBundle:User', 'u')
->join('GatewayBundle:Partner', 'p')
->where('u.id = t.user')
->andWhere('p.id = t.partner');
What is the correct syntax for this type of query?