CakePHP 2.1 find using contain with condition
I have the following models. Industry(id, name) Movie(id, name, industry_id) [Industry has many movies] Trailer(id, name, movie_id) [Movie has many trailers] I need to find 6 latest trailers for each Industry . Every movie does not need to have a trailer or can have multiple[0-n]. The results must contain array of movies with atleast one trailer. $this->Industry->find('all', array( 'contain' => array( 'Movie' => array( 'Trailer' => array( 'limit' => 1 ), 'order' => 'Movie.release DESC', 'limit' => 6 ) ), 'order' => 'Industry.name ASC' )); Option 1 (best option IMO): You were on the right track