On Jul 10, 5:22 pm, inVINCable <[EMAIL PROTECTED]> wrote:
> Hey guys,
>
> I am trying to paginate the results after creating an association on
> the fly that lets me search the results of a HABTM association. This
> is what it look like...
>
> $userschool = $this->Session->read('User.school_id');
> $this->Story->bindModel(array('hasOne' =>array('StoriesTag' =>
> array())));
> $condition['Story.school_id'] = $userschool;
> $condition['StoriesTag.tag_id'] = $tagid;
> //$this->set('test',$this->Story->findAll($condition));
>
> Now it works fine just like this, although I don't want a findAll()
> statement, I want to paginate the results. So I have tried all
> different kinds of combinations of this:
> $this->set('test',$this->paginate('Story', $condition));
>
> And no matter what I do, nothing seems to work. :(
>
> It keeps throwing me an error because there is no "StoriesTag.tag_id
> in the stories field. But I though paginate worked exactly the same
> functionally to that of a findAll() statement?
>
> I'm sure I am doing something wrong, could someone please offer
> advice.
>
> Thank you.
Check the parameters for bindAll, by default it is bound for one
query, you want to make it permanent.
hth,
AD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---