[TYPO3-mvc] order by "calculated attribute" - several approaches
Dmitri Pisarev
dimaip at gmail.com
Wed Jun 9 11:28:43 CEST 2010
> Hi Dimitri,
Hi Chris!
>
> that's what I tried in first place. I implemented a ViewHelper that
> calculates the average rating to show in FE. But this still left me with
> the problem of the orderBy. As I wrote I need the logic of
> rating-average at the point where I am fetching data from the database,
> so to say "order by average_rating".
My quick and dirty approach was to sort in the viewhelper as well:
$arr = Tx_MvcExtjs_ExtJS_Utility::encodeArrayForJSON($items);
parent::sort($arr,"title");
> Now I follow the hint of Jigal and de-normalize my data.
I do realize it's slow and dirty, so the suggestion from Jigal would
suite you better I'm sure.
> Regards
> Chris
Cheers,
Dmitri.
More information about the TYPO3-project-typo3v4mvc
mailing list