Important: #106764 - Public access to number of items of paginators 

See forge#106764

Description 

The abstract class \TYPO3\CMS\Core\Pagination\AbstractPaginator provides two new public methods:

  • getTotalNumberOfItems() returns the total number of all items, regardless of the current page.
  • getNumberOfItemsOnCurrentPage() returns the number of items on the current page.

Both values have been calculated by the paginators before, but were only accessible from within the paginator classes. As all paginators of the Core, for example \TYPO3\CMS\Core\Pagination\ArrayPaginator , \TYPO3\CMS\Core\Pagination\QueryBuilderPaginator and \TYPO3\CMS\Extbase\Pagination\QueryResultPaginator , extend this class, the information is available for them without an additional query, for example in a Fluid template:

Showing {paginator.numberOfItemsOnCurrentPage} of
{paginator.totalNumberOfItems} records
Copied!

Custom paginators extending AbstractPaginator provide the new methods automatically. Custom paginators which already implement methods with the same names must ensure these are public and return an integer.