Hi
Struggling to understand how ORM working… can someone explain how I would write the following to retrieve the results based on the foreign key which is ‘partner_id’ rather than fetching all the records back in the database table, so the url would be /partners-waters/1 displaying only the waters that, that partner owns?
public function index()
{
$this->paginate = [
'contain' => ['Partners', 'StandardWaterTypes'],
];
$partnersWaters = $this->paginate($this->PartnersWaters);
$this->set(compact('partnersWaters'));
}