has ever experienced this issue and knows how to solve it.
Please, help me! :-)
On Dec 21, 9:06 am, thomaus <tho...@saimiris.com> wrote:
> Nobody no clue?
>
> On Dec 19, 2:43 am,thomaus<tho...@saimiris.com> wrote:
>
> > Hi,
>
> > I have to do a 2nd order filter por pagination.
>
> > My pagination var:
>
> > var $paginate = array(
> > 'limit' => 10,
> > 'fields' => array('Campaign.id', 'Campaign.name',
> > 'Campaign.description'),
> > 'order' => array(
> > 'Campaign.id' => 'asc'),
> > );
>
> > My controller function:
>
> > $this->Campaign->recursive = 2;
> > $filter = array('UserCampaign.id = ' => 2);
> > $campaigns = $this->paginate(null, $filter);
> > pr($campaigns);
>
> > This works great and outputs this:
>
> > Array
> > (
> > [0] => Array
> > (
> > [Campaign] => Array
> > (
> > [id] => 2
> > [name] => Newsletter
> > [description] => Newsletter campaign
> > )
>
> > [UserCampaign] => Array
> > (
> > [id] => 2
> > [user_id] => 204
> > [campaign_id] => 2
> > [User] => Array
> > (
> > [id] => 204
> > [parent_id] => 0
> > [username] => barça
> > [fname] => Thomas
> > )
>
> > [Campaign] => Array
> > (
> > [0] => Array
> > (
> > [id] => 2
> > [name] => Newsletter
> > [description] => Newsletter
> > campaign
> > [active] =>
> > [created] =>
> > [modified] =>
> > )
>
> > )
>
> > )
>
> > )
>
> > )
>
> > Now the problem is that I want and I need to write something like
> > this:
>
> > $this->Campaign->recursive = 3;
> > $filter = array('UserCampaign.User.parent_id = ' => 204);
> > $campaigns = $this->paginate(null, $filter);
> > pr($campaigns);
>
> > and this outputs:
>
> > Warning (512): SQL Error: 1054: Unknown column
> > 'UserCampaign.User.parent_id' in 'where clause'
>
> > which is only logical.
>
> > But then my question is : what do I have to write to get a pagination
> > with a condition based on 2nd recursive order???
>
> > Thanks in advance.
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
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:
Post a Comment