[TYPO3-mvc] order by "calculated attribute" - several approaches

Christian Baer chr.baer at googlemail.com
Wed Jun 9 13:33:37 CEST 2010


Am 09.06.10 11:28, schrieb Dmitri Pisarev:
>> 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.

Hi Dimitri,

thanks for the hint. I allready implemented it with the 
de-normalization, and it works! That's all i wanted :)

Cheers


More information about the TYPO3-project-typo3v4mvc mailing list