$bookmarks is an array of Bookmark.id's
Array
(
[0] => ad0d27cd3d5
[1] => c0c61faf4ec
[2] => 5d58e5e97bb
)
But I cant seem to get it to work when doing it this way.
$data = $this->paginate('Bookmark', array('Bookmark.id' =>
$bookmarks,'contain' => array(
'Job' => array(
'conditions' =>array(
'Job.status' => 0 ,
'Job.rank <=' => $rank),
'fields' =>array(
'Job.title',
'Job.rank',
'Job.created',
SUBSTR('Job.description', 0, 50),
'Job.id',
'Job.quickapply')
))));
-----Original Message-----
From: brian [mailto:[email protected]]
Sent: August-16-09 3:49 PM
To: [email protected]
Subject: Re: Another Paginate Question
Difficult to say without seeing how you're adding the contain block to your
$paginate array.
On Sun, Aug 16, 2009 at 2:11 PM, Dave Maharaj ::
WidePixels.com<[email protected]> wrote:
>
> I cant seem to get 'contain' in my pagination.
>
> controller:
> function index()
> {
> $bookmarks =
> $this->Bookmark->__getBookmarks($this->Auth->user('id'));
> $data = $this->paginate('Bookmark', array('Bookmark.id' =>
> $bookmarks));
> $this->set('bookmarks', $data);
> }
>
> I need to add this:
>
> 'contain' => array(
> 'Job' => array(
> 'conditions' =>array(
> 'Job.status' => 0 ,
> 'Job.rank <=' => $rank),
> 'fields' =>array(
> 'Job.title',
> 'Job.rank',
> 'Job.created',
> SUBSTR('Job.description', 0, 50),
> 'Job.id',
> 'Job.quickapply')
> ))
>
> What ever I try I end up with
> SQL Error: 1054: Unknown column 'contain' in 'where clause'
>
> Ideas where I am going wrong?
>
> Thanks,
>
> Dave
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---