Monday, August 3, 2009

Re: Contain conditions

That couldn't be set in the class variable but you could add it into
the array within the action.

public $paginate = array(
'Post' => array(
...
)
);

public function function index()
{
$this->paginate['Post']['contain'] = array(
...
);
}

Having said that, it doesn't seem to me that what you want to do
requires Containable. Instead, you need only adjust the conditions.

public function function index()
{
/* get the list of Post IDs that this User has bookmarked
*/
$post_ids = ...

$this->paginate['Post']['conditions'] = array(
'NOT' => array(
'Post.id' => $post_ids
)
);
...
}

On Sun, Aug 2, 2009 at 11:05 PM, Dave Maharaj ::
WidePixels.com<dave@widepixels.com> wrote:
> Just wondering if this is possible or how to go about it
>
> Site has Posts from various users....
>
> Now a User can bookmark posts they like and save them, now when they view
> the posts/index page how can i set pagination to contain so that it does not
> shows posts that the user has saved.
>
> Dave
> >
>

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

No comments: