[TYPO3-mvc] Set sorting of relations

Pascal Jungblut mail at pascal-jungblut.com
Mon Nov 29 18:06:44 CET 2010


Hi Dennis,

On 17.11.2010, at 10:46, Dennis Ahrens wrote:
> I've solved sorting by rewriting the ObjectStorage in the way i'd like the related objects to be sorted. Iterating over the "old" ObjectStorage applying the objects in the order i'd like to achieve to the new ObjectStorage. After that i replace the assigned ObjectStorage with the "sorted" one.
> I don't know if there is a cleaner way to do this - but it works for me.

thanks for your reply. AFAIK sorting the objects in the object storage does only sort them temporarily. And, even if Extbase does care about persisting the changes, you'd have to load all the objects, put the new one on the position where it belongs and then persist all objects again.
I went with a custom solution and i'm now sorting them manually with exec_UPDATEquery(). That works just fine but is totally ignoring the framework.

I think it would be really nice to have the possibility to sort objects directly by telling the ObjectStorage. Because I'd like to implement this, I filed a bug at forge [1]. It would be nice if you guys could give some feedback on the idea.

[1] <http://forge.typo3.org/issues/11139>

Regards
Pascal



More information about the TYPO3-project-typo3v4mvc mailing list