If you search for an Auction, Cake will automatically get you all the  
linked Categories with it, and vice versa.
So if you want to find all Auctions in Category X, do
$this->Category->find( /* appropriate conditions here */ );
and you'll get the correct Category and all Auctions linked with it.

Note that if your controller does not use Category as its primary  
model, you'll have to go through $this->Auctions->Category..., which  
in the end is the same (search the group on this topic, has been  
explained before).

Play around with debug($this->Category->find()) for a while and you'll  
get the hang of it.

On 23 Oct 2008, at 08:34, cem wrote:

>
> Hi I have auctions which can have more than one category . I want to
> get the categories which belongs to a specified auction .
>
> So the Category HABTM Auction . Thats Right because I can store data
> in the join table . My problem is :
>
>   While fetching data what will I do ?
>
>    $this->Auction->Category->find('all' ,array('conditions'...))
>
>   was an advice from the chat which does not work any other ideas ?
>
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to