I, and, many, others, had the issue that it’s not possible to apply a default sorting for child objects of the type Tx_Extbase_Persistence_ObjectStorage with extbase. For exmpale, I happen to have a „course“ object which stores „event“ objects. The default getter would just
without no possibility to define in what ordering the objects are returned.
Setting the default ordering in the event repository has no effects whatsoever. But the problem is actually pretty easy to solve. Just create an instance of the child object repository in the parent model and then you can use the default findBy methods. Lets say your parent object is called „Parent“ then you’d use findByParent($this->getUid());
In the child repository apply your sorting and do whatever you like:
http://www.noelboss.com/wp-content/uploads/2013/12/noelboss-logo1.png00noelbosshttp://www.noelboss.com/wp-content/uploads/2013/12/noelboss-logo1.pngnoelboss2012-11-09 09:55:472012-11-09 10:21:39Apply sorting for Extbase ObjectStorage