> Hi,
>
> I use "$this->paginate =" because the conditions are dynamic for each
> action so i define it inside the action.
>
> I'm in "measurements" controller and trying to reach "chips".
> What is the exact syntax i should write in the contain?
> is it
> "
> contain => array(
> 'Result' => array('Chips')
> " ?
It should be Chip, not Chips.
As I understand your associations, you should use:
var $paginate = array(
'Measurement' => array(
'limit' => 10,
'page' => 1,
'order' => array('Measurement.created' => 'DESC'),
'fields' => array(
'Measurement.id'
),
'contain' => array(
'Result' => array(
'fields' => array(
'Result.id', 'Result.measurement_id', 'Result.chip_id'
),
'Chip' => array(
'fields' => array(
'Chip.id'
)
)
)
)
)
);
Change limit and order to what you want and add any other fields for
each model, but these are the minimum you need to specify (if you
specify any at all). If that's not working you should check that the
associations are correct in the first place.
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