[TYPO3-mvc] How to get calculated data from a query into an object?

Martin Kutschker masi-no at spam-typo3.org
Wed Feb 17 21:22:33 CET 2010


Franz Koch schrieb:
> http://pastebin.com/m2778270a

This lacks elegance ;)

$dataMapper = Tx_Extbase_Dispatcher::getPersistenceManager()->getBackend()->getDataMapper();

> As you might notice I've implemented a flag "enableResultCount". With
> this I can count the total results and still only get a subset back in
> one go without a second query counting the results. I implemented this
> for pagination purposes etc. and hope it's faster then firing a second
> query.

If you don't care about DBAL you could use this Mysql feature:

SELECT SQL_CALC_FOUND_ROWS ....
SELECT FOUND_ROWS()

Masi


More information about the TYPO3-project-typo3v4mvc mailing list