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 cake-php@googlegroups.com
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