final class PaginationFactory (View source)

Methods

__construct(ServerRequestInterface $request, int $defaultPerPage = 20, int $maxPerPage = 200)
fromArray(array $items, int|null $page = null, int|null $perPage = null, string $pageName = 'page', string|null $basePath = null, array|null $query = null)
fromQueryBuilder(QueryBuilder $builder, int|null $page = null, int|null $perPage = null, string $pageName = 'page', string|null $basePath = null, array|null $query = null)

Details

__construct

__construct(ServerRequestInterface $request, int $defaultPerPage = 20, int $maxPerPage = 200)

No description

Parameters

ServerRequestInterface $request
int $defaultPerPage
int $maxPerPage

fromArray

PaginationResult fromArray(array $items, int|null $page = null, int|null $perPage = null, string $pageName = 'page', string|null $basePath = null, array|null $query = null)

No description

Parameters

array $items
int|null $page
int|null $perPage
string $pageName
string|null $basePath
array|null $query

Return Value

PaginationResult

fromQueryBuilder

PaginationResult fromQueryBuilder(QueryBuilder $builder, int|null $page = null, int|null $perPage = null, string $pageName = 'page', string|null $basePath = null, array|null $query = null)

No description

Parameters

QueryBuilder $builder
int|null $page
int|null $perPage
string $pageName
string|null $basePath
array|null $query

Return Value

PaginationResult