Hi grigri,

Thanks for your answer. I hope your head is well by now ;-) I tend to bite in 
my table in such cases :cD

[1] found the solution see 2


[2] I have contaninable for all my models.... But I had the file placed in the 
wrong folder. Ouch.

It did help! Thank you I will gnaw a bit on my table now....


Anja



-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[EMAIL PROTECTED] Im Auftrag von grigri
Gesendet: Montag, 24. November 2008 12:53
An: CakePHP
Betreff: Re: Pagination with containable: Contain has to effect


Two things to try:

[1] See if it works if you set the `paginate` as a model property.
i.e.  var $paginate = array(...), not setting it dynamically as your doing. Not 
sure why this might make a difference, but you never know.

[2] Make sure your model actually uses the containable behaviour (sounds 
stupid, but last week I had a silly typo meaning that the model wasn't using 
containable which led to exactly your problem.
There is now a grigri's-head-shaped dent in the wall)

hth
grigri

On Nov 24, 11:28 am, "Liebermann, Anja Carolin"
<[EMAIL PROTECTED]> wrote:
> Hi everybody,
>
> I try to combine pagination with containable behaviour, but the 
> "contain" doesn't seem to have any effect.
>
> I tried two variation of the syntax:
>
>                 $this->paginate['Hotel'] = array(
>                         'limit' => 10,
>                         'order' => array ('Hotel.name' => 'asc'),
>                         'url' => $paginator_params,
>                         'condition' => $paramhotel,
>                 'contain'=> array(
>                     'Hotelmaster'=> array('conditions'=> 
> $parammaster),
>                     'Ort',
>                     'Praefix',
>                     'Zielgebiet',
>                     'Saison',
>                     'Sprache',
>                     'Mandant',
>                     'User'=> array('fields'=> 'User.name'))
>                 );
>
> And
>
>             $this->paginate['Hotel']['contain']= array(
>                     'Hotelmaster'=> array('conditions'=> 
> $parammaster),
>                     'Ort',
>                     'Praefix',
>                     'Zielgebiet',
>                     'Saison',
>                     'Sprache',
>                     'Mandant',
>                     'User'=> array('fields'=> 'User.name'));
>                 $this->paginate = array(
>                         'limit' => 10,
>                         'order' => array ('Hotel.name' => 'asc'),
>                         'url' => $paginator_params,
>                         'condition' => $paramhotel
>                 );
> But in both cases I get much more related models in my array than I 
> requested.
>
> Is this a bug or did I do something wrong?
>
> Many thanks in advance for any help and hints!
>
> Anja


--~--~---------~--~----~------------~-------~--~----~
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