Re: findAllByFieldName in a manyToMany relation

2006-07-31 Thread John David Anderson (_psychic_)


On Jul 31, 2006, at 2:53 PM, [EMAIL PROTECTED] wrote:

>
> OK, I have Post and Category, they both hasAndBelongsToMany each  
> other,
> how can I get all posts in one category,

$this->Category->find('id = '.$id);

> and all categories inone Post,

$this->Post->find('id = '.$id);

> that's the question :-).

Print_r() out the results of those calls, and you should see the  
associated models (given that your association has been set up  
correctly).

-- John

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: findAllByFieldName in a manyToMany relation

2006-07-31 Thread [EMAIL PROTECTED]

OK, I have Post and Category, they both hasAndBelongsToMany each other,
how can I get all posts in one category, and all categories inone Post,
that's the question :-).


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: findAllByFieldName in a manyToMany relation

2006-07-31 Thread John David Anderson


On Jul 31, 2006, at 2:37 PM, [EMAIL PROTECTED] wrote:

>
> Hi everyone, I'm trying to do something like this:
>
> findAllByFieldName(), in a relation hasAndBelongsToMany, so I don't
> have a field to look for, do you know which method should I use to do
> this?

Give us a more concrete example - what you've asked here seems a  
little contradictory.

-- John

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



findAllByFieldName in a manyToMany relation

2006-07-31 Thread [EMAIL PROTECTED]

Hi everyone, I'm trying to do something like this:

findAllByFieldName(), in a relation hasAndBelongsToMany, so I don't
have a field to look for, do you know which method should I use to do
this?

Thanks in advance.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---