[TYPO3-mvc] extbase mm relation / objectStorage

Ingo Franzen franzen at faktor-it.de
Mon Mar 7 20:32:42 CET 2011


Hello,

Thanks again for your quick reply!

Still no effect on my objectStorage, but I think the problem resists somewhere on my side here,
maybe I dont see the forest in front of all those trees around me ;).

Ill have a closer look on my code/configuration, so far it works with a small function in my repsoitory which looks like this:

 
public function findFridgesByFood($food) {
        $query = $this->createQuery();
        return $query->matching($query->contains('foods', $food))
        ->setOrderings(array('name' =>  Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING))
        ->execute();
    }
}

This way a get as a result all Fridges which contain a selected food which I can show in the view sorted by name then.

The result would be the same when I just attach a $food->getFridges() to the view, but then its still not sorted by name...


Best Regards,
Ingo


-----Ursprüngliche Nachricht-----
Von: typo3-project-typo3v4mvc-bounces at lists.typo3.org [mailto:typo3-project-typo3v4mvc-bounces at lists.typo3.org] Im Auftrag von Franz Koch
Gesendet: Montag, 7. März 2011 18:19
An: typo3-project-typo3v4mvc at lists.typo3.org
Betreff: Re: [TYPO3-mvc] extbase mm relation / objectStorage

Hey Ingo,

> Thank you for your reply. I am not sure whether I did the sorting 
> definition in TCA right, but this had no impact on the sorting of the 
> rendered objectStorage:
>
> 'default_sortby' =>  'ORDER BY parent.childProperty ASC' (i this even
> right??)
>
> Maybe you give me another hint??

you have to define the default sorting/ordering for the property itself, not in the ctrl-section of the table.

'yourColumnName' => array(
   'config' => array(
     'foreign_table' => 'tx_yourext_domain_model_table',
     'foreign_table_where' => ' ORDER BY tx_yourext_domain_model_table.childProperty ASC'
   ),
),


-- 
kind regards,
Franz Koch
_______________________________________________
TYPO3-project-typo3v4mvc mailing list
TYPO3-project-typo3v4mvc at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


More information about the TYPO3-project-typo3v4mvc mailing list