Yes, it was a typo. tnx for the notice.
> 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.
1) I dont have 'Result.measurement_id' since "Result hasMany
Measurement "
2) I followed your instructionsand right now my contain array looks
like this:
Array
(
[Type] => Array
(
[fields] => Array
(
[0] => Type.name
)
)
[Result] => Array
(
[fields] => Array
(
[0] => Result.chip_id
)
[Chip] => Array
(
[fields] => Array
(
[0] => Chips.corner
[1] => Chip.id
)
)
)
)
I'm looking to add a constraint to my query: Chips.corner = $value
The problem is that even after these contain, the cake's query still
doesn't join "chips" table and only results and types
Is the contain array right this time?
3) I still use
$this->paginate = array(
//'recursive' => 2,
'conditions' => $conditions,
'contain' => $contain
);
instead of var $paginate... since I'm building a filter page for a
table(for measurements) so I'm building the contain array dynamically
from input from the page.
Its not suppose to be a problem right?
Thank you SO much for your help.
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