events/Classes/Pagination/Factory.php
Daniel Siepmann a9f3f108e3
BREAKING: Change of vendor/namespace (#43)
The vendor was renamed from `wrm` to `werkraummedia`.
And the namespace vendor was renamed from `Wrm` to `WerkraumMedia`.

That way all references to PHP classes as well as the package name
itself need to be adjusted.
2023-11-09 10:27:43 +01:00

25 lines
668 B
PHP

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