Monday, November 3, 2008

Pagination with HasMany and SQL Aggregation

I'm not sure that this is possible but if it is, it would put Cake
into a special place in my heart. I have 2 related models Articles
and Ratings.

Articles hasMany Ratings

A Rating has a User ID an Article ID and a Rating #. In order to get
an articles rating I need to query all ratings by the Article ID and
average them out.

How would I paginate all Articles ordered by Rating?
--~--~---------~--~----~------------~-------~--~----~
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: