[TYPO3-mvc] Repository: sort by sorting of relation from mm table

Thomas Mammitzsch thomas at visualworx.de
Wed Jul 23 10:41:45 CEST 2014


Don't you list the products of only one category at a time? If the 
products property inside category is not lazy, it already contains the 
products. Then you just sort them in the product getter of the category 
instance.

regards, Thomas

On 23.07.2014 08:33, Moritz Ahl wrote:
> I could of course iterate through all demanded categories for and for
> each category i can call $categoriy->getProducts() and write the result
> in an array of something. Then, the products for each category are in
> fact already sorted correctly, and in fact that's what I'm doing right
> now as a workaround.
> But AFAIK this approach internally produces one DB call for each
> category, which does not seem well-performing design to me - correct me
> when i'm wrong.



More information about the TYPO3-project-typo3v4mvc mailing list