CakePHP : Recursive Association Queries
The following patch allows queries through multiple layers of database associations.
For example, if you have models User, City, State, Country and you want users who
live in coutries that start with 'A' you can now specify:
Note: At this time it does not work when one of the associations in the path is 'external' or of type 'hasAndBelongsToMany'.
$this->User->findAll("City::State::Country.country_name like 'A%');
or users in the USA ....
$this->User->findAll(array("City::State::Country.country_name" => "USA"));
For 1.1.9 users:
dbo_source.1.1.x.3794+recursive-query-2.patch or
dbo_source.1.1.x.3794_recursive-query-2.php
Note: At this time it does not work when one of the associations in the path is 'external' or of type 'hasAndBelongsToMany'.




