[FLOW3-general] Getting all Values of some Objects Property
Martin Kutschker
masi-no at spam-typo3.org
Sun Jan 24 13:54:24 CET 2010
marc neuhaus schrieb:
> Hey!
>
> I was wondering how i would accomplish something equivalent to this:
> "SELECT date FROM posts GROUP BY date;"
>
> My first idea was to get All Objects through findAll() an iterate over all
> of them and compiling an array of the Used Properties:
> for($posts as $post)
> $dates[$post->getDate()]++;
>
> Problem with this is, that this would take way to long if there are lots of
> $posts.
The DDD books suggests that a repository may have specialized hard-coded queries that don't return
objects or collections of objects, but do some basic calculation like counting objects or doing sums
on value objects.
Don't know if this falls in the category mentioned in the book.
Masi
More information about the FLOW3-general
mailing list