[TYPO3-mvc] query->setOrderings: order by value list
Stephan Helten
stephan.helten at engage.de
Tue Jul 5 10:56:10 CEST 2011
Hi,
I have a controller with a flexform like this:
<settings.flexform.persons>
<TCEforms>
<label>LLL:EXT:eng_persons/Resources/Private/Language/locallang_db.xml:pi_fl
exform_person.persons</label>
<config>
<type>group</type>
<internal_type>db</internal_type>
<allowed>tx_engpersons_domain_model_person</allowed>
<size>10</size>
<maxitems>100</maxitems>
<minitems>1</minitems>
<show_thumbs>0</show_thumbs>
</config>
</TCEforms>
</settings.flexform.persons>
The customer is able to define a custom order of the entities in the
backend.
In my person repository I have a function findByUids expecting a comma
separated list of uids (from the flexform value).
Wouldn't it be nice to have the ability to call query->setOrderings with the
provided list to define the ordering exactly as given in the backend?
The ordering by ASC and DESC is not powerful enough to handle this usecase.
MySQL, for instance, offers the function ORDER BY FIELD to support such
cases:
<http://lists.mysql.com/mysql/209784> http://lists.mysql.com/mysql/209784
Is there already a "best practice" to solve my kind of problem?
regards
Stephan Helten
More information about the TYPO3-project-typo3v4mvc
mailing list