public
|
__construct(
array-key|null $pageKey = null,
(Closure(mixed): list<mixed>)|array-key|null $entitySelector = null,
int<1, max>|null $pageSize = null,
)
Creates a new QueryPager object
Creates a new QueryPager object
Parameters
$pageKey |
The value to increment in the query string
of each request, or null to use the first value in the query. Added to
the second and subsequent requests if missing from the first.
|
$entitySelector |
Entities
are returned from:
-
$entitySelector($data) if $entitySelector is a closure
-
Arr::get($data, $entitySelector) if $entitySelector is a string or
integer, or
-
$data if $entitySelector is null
|
$pageSize |
Another page is requested if:
-
$pageSize is null and at least one result is returned, or
- exactly
$pageSize results are returned
|
|
#
|
public
|
getPage(
$data,
RequestInterface $request,
HttpResponseInterface $response,
CurlerInterface $curler,
?CurlerPageInterface $previousPage = null,
?array $query = null,
): CurlerPageInterface
Convert data returned by the endpoint to a new page object
Convert data returned by the endpoint to a new page object
Parameters
$query |
The query applied to $request or returned by
{@see CurlerPageRequestInterface::getNextQuery()}, if applicable.
|
Implements
|
#
|