[TYPO3-mvc] extbase SetOrderings doesn't work

Nikolas Hagelstein lists at shr.cc
Mon Jan 24 17:42:08 CET 2011


Hi,

> public function listOfBandsInYearBy($year,$sortby,$sorttype){
>        $frage = $this->createQuery();
>        $frage->matching($frage->equals('year',$year) );
>        if($sortby=='ORDER_ASCENDING'){
>                  $frage->setOrderings(array($sorttype =>
> Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING) );
>        }
>        else{
>                  $frage->setOrderings(array($sorttype =>
> Tx_Extbase_Persistence_QueryInterface::ORDER_DESCENDING) );
>        }
>        return $frage->execute();
> }
>

aeh? for me it looks as if you mismatched $sorttype and $sortby.
At least from the naming i would consinder sortby containing a field 
namen while sorttype should indicate ascending or descending.

Cheers,
NIkolas


More information about the TYPO3-project-typo3v4mvc mailing list