I have been attempting to use CakePHP 3's query builder format in order to learn how to better use it. However, at the moment I cannot seem to get a left join working.
There is information available in both tables that I would like to collect in the result:
$query = $this->find()->where(['userID' => $UID])->hydrate(false)->join([
'table' => 'authgroups',
'alias' => 'a',
'type' => 'LEFT',
'conditions' => 'a.id = userGroup'
]);
return $query->toArray();
If I'm reading the CookBook correctly, this should work - however, it is being used in a model which differs from the example, and the result only returns from that table, seemingly ignoring the join. Do I need to execute this in the controller instead?