Project

General

Profile

Actions

Feature #102194

open

Paginator for QueryBuilder

Added by Philipp Kitzberger about 1 year ago. Updated 11 months ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2023-10-18
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Currently there's two Paginators in the core:

  • \TYPO3\CMS\Core\Pagination\ArrayPaginator
  • \TYPO3\CMS\Extbase\Pagination\QueryResultPaginator

Neither of them is ideal for QueryBuilder results, right?

Sure we could use ArrayPaginator like this:

$query = $queryBuilder->select('*')->from('tt_content');
new ArrayPaginator($query->executeQuery()->fetchAll(), $currentPage, $itemsPerPage);

But this will always fire the whole SELECT statement without any LIMIT to the database.

I suggest to add a 3rd paginator to the core: QueryResultPaginator

Actions

Also available in: Atom PDF