Search code examples
typo3extbasetypo3-7.6.xtypo3-extensions

TYPO3 extension how to limit findAll (best practise)


Hi what is the best practise to limit the result of findAll in TYPO3?

I want to do it in controller.

Thanks in advance.


Solution

  • You can change the query in the controller as well:

    $this->myRepository->findAll()->getQuery()->setLimit(4)->execute();