Trying to use multiple fields in my find method -
$users = $this->AdressesUsers->users->find(\'list\', [
\'keyField\' => \'id\',
I'd suggest you to use Queries As Collection Objects here. Try this:
$users = $this->AdressesUsers->Users->find()
->map(function ($row) { // map() is a collection method, it executes the query
$row->fullName = $row->firstname . ' ' . $row->lastname;
return $row;
})
->combine('id', 'fullName') // combine() is another collection method
->toArray(); // Also a collections library method
pr($users); // Check your result