Friday, September 24, 2010

Please suggest how to Sort by related/Child Model field..

I would be thankful if you can please help me.
I have a complex problem here which need to fix. It's about the
following
situation:

I have a model "Artist" that has a relation to some models like songs,
lessons, lessonsParts. I want to paginate the Artist-Model and sort
the relationship by 'LessonParts' .'CreatedDate DESC'. So I will have
the following table-
structure in my view:

Id Artist SongsNumber LessonNumbers
2 Ben 5 15
5 Mary 8 20

I am trying to sort the related model by run time bindModel but IT
didnt worked out.. I just can not access child/related Model/table
fields... please suggest..

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: