cake-php@googlegroups.com
[Top] [All Lists]

Re: 3 models and search condition

Subject: Re: 3 models and search condition
From: John Andersen
Date: Sat, 12 Jun 2010 10:25:13 -0700 PDT
I suggest you study the section about retrieving data in the CakePHP
book at:
http://book.cakephp.org/view/1017/Retrieving-Your-Data

Set the recursive parameter to 2 when you retrive the data in the
Category model, like:
[code]
$this->find(
   'all', array(
      'conditions' => array(
         'Category.id' => $id
      ),
      'recursive' => 2
   )
);
[/code]

Try it out!
Later when you are more comfortable with the find statement, take a
look at the Containable behavior in the CakePHP book at:
http://book.cakephp.org/view/1323/Containable

Using that will make your find statements easier to work with.
Enjoy,
   John

On Jun 12, 8:15 pm, viciat <viciuasc...@xxxxxxxxx> wrote:
> Yes.
>
> I want to display the locations that are found in the offers of a particular
> category.
>
> When the user selects the Category with, let's say id 3, I want to display
> the locations that are found in the offers of that category and I don't know
> how.

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@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

<Prev in Thread] Current Thread [Next in Thread>