[TYPO3-mvc] Ordering ignored

Philipp philippwrann at gmx.at
Thu Feb 28 21:41:27 CET 2013


Hey

In one model (called event) i have a property called irregularOccasions. It is an objectStorage filled with Models... Those are defined @lazy.

If i need only a few of those occasions (because i only need to display ~5 on one page, but the model has about ~200) i have two BIIIIIIIG Problems.

1st) No Ordering.
In the repository of the Model IrregularOccasion i have set the ordering to dateFrom ASC
protected $defaultOrderings = array('dateFrom' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING);
-> this is ignored, i simply get completely shitty results

2nd) I have to get all occasions with 
$allOccasions = $event->getIrregularOccasions()->toArray() be able to display only 5...

How can i get just 5 or 1 of those Occasions? This overhead is massive. On a detail view its not a big problem but if i think about listings with 20 or 30 events and i have to get the closest occasion for each of them?

Whats the correct approach?


More information about the TYPO3-project-typo3v4mvc mailing list