[TYPO3-mvc] own sorting with extbase

Alexander Averbukh alav at gmx.net
Fri Jan 24 11:08:04 CET 2014


Hello all,

My query looks like this:

     $sorting = array('3', '1', '2', '7', '8', '5')
     $query = $this->createQuery();
     $query->getQuerySettings()->setRespectStoragePage(FALSE);
     $query->matching($query->in('uid', $sorting));
     $results = $query->execute();  

How can I define the order of the entries? I want that, the sequence looks like this:

entry with uid=3
entry with uid=1
entry with uid=2
entry with uid=7
entry with uid=8
entry with uid=5

Is it possible with extbase or should I make it with php? 
I have tried to work with $results as an array . Unfortunately it does not work.

$temp = $results[0];
$results[0] = $results[1];
$results[1] = $temp;


The order remains unchanged. 
Thank you for your help.




More information about the TYPO3-project-typo3v4mvc mailing list