Add interface for pagination

This commit is contained in:
2023-11-27 18:14:07 +01:00
parent 930a76cc66
commit cef218fed5
4 changed files with 103 additions and 20 deletions

View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\MainBundle\Pagination;
/**
* Create paginator instances.
*/
interface PaginatorFactoryInterface
{
/**
* create a paginator instance.
*
* The default route and route parameters are the current ones. If set,
* thos route are overriden.
*
* @param string|null $route the specific route to use in pages
* @param array|null $routeParameters the specific route parameters to use in pages
*/
public function create(int $totalItems, string $route = null, array $routeParameters = null): PaginatorInterface;
public function getCurrentItemsPerPage(): int;
public function getCurrentPageFirstItemNumber(): int;
public function getCurrentPageNumber(): int;
}