In the Users controller i created a function browse() that, after
selecting the users and their profiles, sends an array of country id's
(both location and nationality) to a function in the Country
controller:
function userListCountries($ids){
return $this->generateList(array('id' =>
$ids),null,null,'{n}.Country.id', '{n}.Country.country_name');
}
So now i can select any number of users with just 2 queries.
I do prefer the 'cake way' but on this website one of the most
frequent actions will be searching and browsing through user lists..
so this one trick will save lots of server power.
If anyone has a better idea, please let me know! Thanks
On Mar 10, 10:52 pm, "cadaver" <[EMAIL PROTECTED]> wrote:
> You also could try to read entire Countries table into array and after
> that you will only need to know country_id and nationality_id to build
> correct output. This is not the Cake Way but it also could save you a
> few queries. Although nothing con beat custom query of course.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---