I have the following query builder:
$queryBuilder = $this
->createQueryBuilder(\'recipient\')
->leftJoin(\'recipient.message\', \'message\')
-&
When using QueryBuilder
, joined tables are not added to the select list automatically. You can call addSelect(TABLE_ALIAS)
to get rid of the error.
$queryBuilder = $this
->createQueryBuilder('recipient')
->leftJoin('recipient.message', 'message')
->addSelect('message') //THIS LINE
->orderBy('message.dateSent', 'DESC');