Skip to content

Instantly share code, notes, and snippets.

@cholnhial
Created May 22, 2015 07:18
Show Gist options
  • Save cholnhial/f8f05c05eeb0dcb9f27c to your computer and use it in GitHub Desktop.
Save cholnhial/f8f05c05eeb0dcb9f27c to your computer and use it in GitHub Desktop.
$client = $this->Clients->get($id, ['contain' => ['Contacts', 'Contacts.ContactTitles', 'Contacts.States' => function($q) {
return $q
->select(['abbreviation']);
}, 'Contacts.Countries' => function($q)
{
return $q
->select(['name']);
}], 'joinType' => 'LEFT']);
echo count($client->contacts);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment