You should be able to make a find with conditions on the category even
if you are retrieving the data from the Location model. Something
like:
[code]
find(
   'all', array(
      'contain' => array(
         'Offer' => array(
            'Offer.category_id' => $id
         )
      )
   )
);
[/code]
That should give you all Location records for the Offers with
category_id equal the requested id!
The code is not tested!
Enjoy,
   John

On Jun 12, 8:29 pm, viciat <viciuasc...@yahoo.com> wrote:
> Yeap, I know about the Containable behaviour.
> The problem with retrieving the categories is another.
> If I get all the categories, I'm gonna probably need to retrieve the
> location from the offers associated with the Category.
>
> If I have 100 offers for a category (with the same location), I'm gonna get
> that location a hundred times.
> --
> View this message in 
> context:http://old.nabble.com/3-models-and-search-condition-tp28866040p288662...
> Sent from the CakePHP mailing list archive at Nabble.com.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to