[FLOW3-general] How to aggregate data?

Mario Rimann typo3-coding at rimann.org
Tue Feb 7 23:22:50 CET 2012


Hi

I'm playing around with a little package that shows an entry form to
collect data and the next step should show a result page, which compares
the entered data to the average values of the already previously entered
data.

For now, I can use $fooRepository->findAll(), iterate over the single
objects and aggregate the data in PHP - but this seems to be the wrong
approach when I expect hundreds or even thousands of elements to be in
the database.

What's the best way to get e.g. an average value of a property from
several objects? (data is available in the database, so the operation
could happen there, no calculations needed within the model object at
the time of reading/calculating).

Cheers,
Mario


More information about the FLOW3-general mailing list