Friday, February 27, 2009

Re: Sorting on additional fields

i wouldn't caluculate the average each time.
add a rating field to your products tabele and add an afterSave method
to your ProductReview Model which calulates the new average and
changes it in the Products Table each time a review is added.
This should be much faster and easyer to handle.

--~--~---------~--~----~------------~-------~--~----~
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: