Copied!

PaginatorFactoryInterface

PaginatorFactoryInterface.php : 15
Interface

Methods

publiccreatePaginator()

PaginatorFactoryInterface.php : 32
public createPaginator(iterable<string|int, object> $items, PageRange $range, int $totalItems) : PaginatorInterface<string|int, object>

Parameters

Name Type Default value Description
$items iterable<string|int, object> -

the items of the requested page only

$range PageRange - -
$totalItems int - -

Return values

PaginatorInterface<string|int, object>

publiccreatePartialPaginator()

PaginatorFactoryInterface.php : 49

Creates the paginator of a collection without a total, for collections whose total is unknown or too costly to count.

public createPartialPaginator(iterable<string|int, object> $items, PageRange $range, bool $hasNextPage) : PartialPaginatorInterface<string|int, object>

The response then has no totalItems. next is linked when the page is full (as many items as the page size) and $hasNextPage is true, and a page with fewer items never links next.

Parameters

Name Type Default value Description
$items iterable<string|int, object> -

the items of the requested page only

$range PageRange - -
$hasNextPage bool - -

Return values

PartialPaginatorInterface<string|int, object>

Tags
Throws
InvalidArgumentException

when $items holds more entries than the page size

publicgetRange()

PaginatorFactoryInterface.php : 22
public getRange(Operation $operation[, array<string, mixed> $context = [] ]) : PageRange|null

Parameters

Name Type Default value Description
$operation Operation - -
$context array<string, mixed> [] -

Return values

PageRange|null

null when pagination is disabled for the operation, so the provider returns the whole collection