[TYPO3-mvc] Ordering of localized records

Fabian Fisahn fisahn at its-immaterial.com
Fri May 6 18:49:25 CEST 2011


On 06.05.11 16:20, Fabian Fisahn wrote:
> Hi List,
> 
> I have list of records in English with localized German translations
> 
> In the repository if have set a my default ordering:
> 
> protected $defaultOrderings = array(
>          'category_name' =>
> Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING
> 	);
> 
> If I do a findAll() in English, I get a list in right order.
> 
> If I do it in German, I got the English ordering, but that's wrong,
> because the German words are different.
> 
> I could do the ordering in the controller within an array, but maybe
> there is extbase native way?

my current solution is

$categories = $this->categoriesRepository->findAll();
		
$allCategories = array();
foreach($categories as $cat){
	$allCategories[$cat->getCategoryName()] = array('uid' =>
$cat->getUid(),'categoryName' => $cat->getCategoryName());
}
ksort($allCategories);

it works but seems a bit complicated.

Fabian


More information about the TYPO3-project-typo3v4mvc mailing list