Hello,
I am trying to provide a virtual property in my entity Notice
Here are my relations:
Lessors hasMany Properties
Properties hasMany Leases
Leases hasMany Notices
I want to get a property from the Lessor which “owns” the Notice.
Here is my code in Notice.php (entity)
$lessors = TableRegistry::get('Lessors'); $query = $lessors->find() ->contain(['Properties.Leases', function($q) { return $q ->select(['id']) ->where([ 'id' => $this->_properties['lease_id'] ]); }]);
got an error:
Illegal offset type in [/var/www/mbail/vendor/cakephp/cakephp/src/ORM/EagerLoader.php, line 413]
What am I doing wrong?