Skip to content

Instantly share code, notes, and snippets.

@gapple
Created July 10, 2012 22:37
Show Gist options
  • Select an option

  • Save gapple/3086657 to your computer and use it in GitHub Desktop.

Select an option

Save gapple/3086657 to your computer and use it in GitHub Desktop.
Cake find with limit on relation
<?php
$this->Client->find('all', array(
'conditions' => array(
),
'joins' => array(
array(
'table' => 'projects',
'alias' => 'ProjectJoin',
'type' => 'INNER',
'conditions' => array(
'ProjectJoin.client_id = Client.id'
),
),
),
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment