[TYPO3-mvc] extbase SetOrderings doesn't work

Johannes C. Schulz - EnzephaloN IT-Solutions info at enzephalon.de
Tue Jan 25 11:56:17 CET 2011


Hi!


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

No, of curse the names are badly choosen, but the values of the variables
are right.

@Franz
With use of DevLog I "extracted" the SQL-Statement and tested it with
phpmyadmin. There the ordering was correct.

Pagination isn't planned for this extension.

Best regards
Johannes



More information about the TYPO3-project-typo3v4mvc mailing list