[TYPO3-mvc] setOrderings: order by FIELD?

Bastian Waidelich bastian at typo3.org
Fri Sep 30 14:31:29 CEST 2011


Sören Kracker wrote:

Hi Sören,

> is it somehow possible or planned to use ordering by FIELD like "ORDER
> BY FIELD(catalog, 33, 47) DESC" using extbase query interface or do you
> have to write the statement yourself?

This is not possible, and I doubt that it will be.
I would be interested in the concrete use case. If you have access to 
the model I would advise you to rework it so that the order in the db is 
natural - if possible.

E.g. if you had a property "importance" with the values "high", "medium" 
and "low" instead of storing the "magic string" [1] you should consider 
storing a value 2,1,0 instead (or similar) and resolve the value in the 
model..


Best,
bastian


[1] http://en.wikipedia.org/wiki/Magic_string


More information about the TYPO3-project-typo3v4mvc mailing list