Containable will return you all posts and will return you only those
comments that have 'test', this is by design (at least for now).

You may want to force a JOIN to strictly filter out the data.

On Aug 19, 10:02 am, "Siegfried Hirsch" <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> using cake 1.2 rc2 I also want to use the Containable behavior.
>
> I have a relation like Post and Comment and I do the following:
>
>         $this->paginate['conditions'] = array('Post.ramble_id' => $rambleId);
>         $this->paginate['contain'] = array('Comment.body LIKE "%test%"');
>                 $this->set('posts', $this->paginate());
>
> 3 Posts where only the post 1 and post 3 have a comments where in the body the
> word "test" is contained. My problem is now, that I also get the post
> 2, which does
> not have a comment and of course there is no body which contains "test".
>
> So my question is: is this intentional or how could I make cake to
> bring back only
> those posts, that have a comment, which meets the condition ?
>
> Siegfried
--~--~---------~--~----~------------~-------~--~----~
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