Tuesday, May 1, 2012

Re: Sort assoc data

Do you mean using Containable? If so, just add an 'order' array under
the associated model.

'contain' => array(
'OtherModel' => array(
'fields' => array(...),
'order' => array(
'OtherModel.column' => 'ASC'
)
)
)

On Tue, May 1, 2012 at 5:55 PM, Michael Gaiser <mjgaiser@gmail.com> wrote:
> So, I have been able to sort queries of the basic model, but how do
> you specify sorting paramaters for the associated models?
>
> --
> Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
>
>
> 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

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate