events/Classes/Pagination/Factory.php
Daniel Siepmann 81065f5c67
BREAKING: TYPO3 v12 support (#44)
* Migrated all fixtures to PHP.
* Removed version specific adjustments.
2023-11-27 10:04:42 +01:00

25 lines
654 B
PHP

<?php
declare(strict_types=1);
namespace WerkraumMedia\Events\Pagination;
use TYPO3\CMS\Core\Pagination\PaginationInterface;
use TYPO3\CMS\Core\Pagination\SlidingWindowPagination;
use TYPO3\CMS\Extbase\Pagination\QueryResultPaginator;
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
final class Factory
{
public function create(
int $currentPage,
int $itemsPerPage,
int $maximumLinks,
QueryResultInterface $items
): PaginationInterface {
return new SlidingWindowPagination(
new QueryResultPaginator($items, $currentPage, $itemsPerPage),
$maximumLinks
);
}
}