[TYPO3-german] Extbase - setOrderings() tut nicht
JCL - Johannes C. Laxander
jc at laxander.com
Sat May 17 23:45:25 CEST 2014
Hallo Thomas,
danke für den Hiweis, da habe ich das wohl falsch verstanden und angewendet. Ich werde es nach deinem Vorschlag machen.
Johannes.
> -----Ursprüngliche Nachricht-----
> Von: typo3-german-bounces at lists.typo3.org
> [mailto:typo3-german-bounces at lists.typo3.org] Im Auftrag von
> Thomas Nussbaumer
> Gesendet: Samstag, 17. Mai 2014 10:52
> An: typo3-german at lists.typo3.org
> Betreff: Re: [TYPO3-german] Extbase - setOrderings() tut nicht
>
> Hi Johannes
>
> Ich verwende folgende Repository-Klasse um *immer* zu
> sortieren. Im Controller genügt dann der Aufruf von
> findAll(). In deiner Funktion ist $query-->setOrderings(...
> nur ein Zusatz. Es fehlen $query-->matching(... und return
> $query-->execute();
>
> /**
> * A repository for person
> */
> class Tx_Kernaarau_Domain_Repository_PersonRepository extends
> Tx_Extbase_Persistence_Repository {
>
> protected $defaultOrderings = array('name' =>
> Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING);
> }
> Liebe Grüsse. Thomas
> (Bitte entschuldige meinen Tippfehler vor einer Woche)
>
> Am 16.05.2014 10:42, schrieb JCL - Johannes C. Laxander:
> >
> > Hallo,
> >
> > ich möchte die Ergebnismenge einer 1:n Relation in einer
> bestimmten Sortierung ausgeben:
> >
> > cruise-A -> Kategorie-X, 1000 €
> > cruise-A -> Kategorie-D, 900 €
> > cruise-A -> Kategorie-L, 950 €
> >
> > Sortiert:
> >
> > cruise-A -> Kategorie-D, 900 €
> > cruise-A -> Kategorie-L, 950 €
> > cruise-A -> Kategorie-X, 1000 €
> >
> > Dafür habe ich in der Repository-Klasse diesen Code:
> >
> > public function findAllSortByCabinCategory() {
> > $query = $this->createQuery();
> > $query->setOrderings(array(
> > 'cabinCategory' =>
> \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING
> > ));
> > }
> >
> > Funktionsaufruf im Controller:
> >
> > $cabinPricePerPersons =
> > $this->cabinPricePerPersonRepository->findAllSortByCabinCategory();
> > $this->view->assign('cabinPricePerPersons', $cabinPricePerPersons);
> >
> > Die Ausgabe erscheint aber nach wie vor "unsortiert".
> Jemand eine Erklärung dafür? Wo liegt der Fehler?
> >
> > Gruß, Johannes.
> >
>
> _______________________________________________
> TYPO3-german mailing list
> TYPO3-german at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german
>
More information about the TYPO3-german
mailing list