On Wed, Oct 20, 2010 at 10:51 AM, ravidp <[email protected]> wrote:
> Hi,
>
> In my tables i have the relations:
>
> Result               hasMany       Measurement
> Measurement    belongsTo     Result
> Result               belongsTo     Chip
> Chip                  hasMany       Result
>
> I try to paginate using:
> $this->paginate = array(
>  'contain' => array('Chip')
> );

Where did you put this? Normally, you'd define your $paginate as a
class variable:

var $paginate = array(
        'ModelName' => array(
                'limit' => 10,
                'page' => 1,
                'order'=>array('ModelName.created' => 'DESC'),
                'fields' => array(
                        'ModelName.id',
                        etc.
                ),
                'contain' => array(
                        'OtherModel' => array(
                                'fields' => array('OtherModel.id', etc),
                                'ThirdModel' => array(...)
                        ),
                        'FourthModel' => array(...)
                )
        )
);

> I have put in all models:
> var $actsAs = array('Containable');

You could put that once, in AppModel.

> but no go,
>
> I tried several variations like:
> array('Chip'=>array('Measurement'))
> array('Chip'=>array('Result'))
> array('Chip' => array('Result' => 'Measurement'))
> array('Chip'=>array('Measurement','Result') )
> array('Chip' => array('Result' => array('Measurement')))

Have you tested that your associations are good? In each model's
controller, try doing a normal find, using recursive = 2, and debug
the results to see if the other model data is coming in.

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