[TYPO3-mvc] groupBy

Franz Koch typo3.RemoveForMessage at elements-net.de
Thu Nov 4 11:58:01 CET 2010


Hey Felix,

> Am 04.11.10 11:02, schrieb Franz Koch:
>> Of course you still might want the grouped results to be mapped on
>> objects, but those have to be out of the scope of the persistence layer.
>
> Yeah, I would love to et
>
> GROUP1
> .Object1
> .Object2
> GROUP2
> .Object3
> .Object4
>
> but this is not like SQL's "group by" works either. Don't know if we
> should implement it this way anyway.

ah, ok - now I got you. Well, how should that work? How would the 
repository know which "group-object" to use and map the results to? Can 
it even be a group-object? How would you access a certain group then? It 
could probably be an array having the "groupBy-value" as key and a 
objectStorage as value.
But I'm not sure if this should be a built in repository feature, should 
it? It probably could be part of a service delivering grouped objects, 
but it might also be in the scope of the view (depending on your other 
needs) and that's what the groupedFor-viewHelper is meant to be used for.

> Otherwise groupBy() would trigger setReturnRawQueryResult() in the
> query-settings.

"setReturnRawQueryResult" right - never remember the correct wording.

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list