Hi,
I'm still struggling with a problem - which should be easy (I think)
but .... :-( Any advice you more experienced folks could give ....?
I want to achieve something akin to the following (building on the
example in the manual):
$this->Recipe->Ingredient->find('all');
my code is
$this->Venue->Contact->find('all',
array('conditions'=>array('jobType'=>'main')));
I am expecting this to retrieve data for venues and contacts where
their jobtype is stated as 'main', but it fetches all venues and all
contacts irrespective of their 'jobType'. I have tried replacing
'all' with 'first' but the same behaviour.
The SQL debug info shows the Venue query running then TWO Contact
queries - the first getting everything, the second filtering as I
want .... how can I switch off the first CONTACT query ...?
How can I get only the 'main' contacts for each venue and then display
in a view?
My latest fudge is to get them all and the filter in the view with:
if ($contact['jobType'] == 'main') { ... }
but I reckon I'm missing something much cleaner than this.
Thanks for your help
Eagle
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---