Hi,
why won’t the following lines in a component create the $user object?
$userstable = TableRegistry::getTableLocator()->get(‘Users’);
$user = $userstable->find()->contain([‘Mailboxes’])->where([‘Users.id’ => $userd]);
echo $user->mailbox->id;
I get the following Error message
Notice (8): Undefined property: Cake\ORM\Query::$mailbox [APP/Controller/Component/SysmessagesComponent.php, line 88]
Notice (8): Trying to get property ‘id’ of non-object [APP/Controller/Component/SysmessagesComponent.php, line 88]
any idea?