[TYPO3-mvc] setOrderings: order by FIELD?

Sebastian Schreiber me at schreibersebastian.de
Fri Sep 30 15:43:50 CEST 2011


Am 30.09.2011 14:31, schrieb Bastian Waidelich:
> 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
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
Hi Sören,
I think you have to write your own sql-statement.
The ordering by FIELD is also very specific to mysql.

@Bastian
A possible use case could be the correct sorting of manually selected 
records.
Have a look at my blog post:
http://blog.schreibersebastian.de/2011/07/sortierung-anhand-einer-csv-list/
(Sorry, only german)

Best,
sebastian

-- 
Sebastian Schreiber
(Medieninformatiker B.Sc.)
(TYPO3 Certified Integrator)

Schanzenstraße 27, Schlosserei 4
D-51063 Köln

T  0221 677 88 541
M  0176 431 05 790

Skype schreibersebastian.de

me at schreibersebastian.de
www.schreibersebastian.de

Steuernummer: 217 / 5269 / 4675



More information about the TYPO3-project-typo3v4mvc mailing list