Hi,
Loading Associations i have three table Artwork_Image, Users, Interests i want following result
Select Interests.id, Artwork_Images, Users.fname, Users.email,Artwork_Images.created from Artwork_Images, Users, Interests
Where Interests.Artwork_Images_id = Artwork_Images.Artwork_image_id
and Interests.User_id - Users.id
i want above result in following code plz. help me in this i am new to cakephp thanks in advance
public function findEnquiryByAlpha(\Cake\ORM\Query $query, array $options){
$query->enableAutoFields(TRUE)
->select(['Interests__id'])
->contain([
'Users' => ['fields' => ['Users.id']],
'ArtworkImages' => ['fields' => ['ArtworkImages.id']],
])
// TODO: Enable below condition to get artists that belong to particular user
->where($options['where']);
return $query;
}
}