PaginatedRequest
in package
Table of Contents
Properties
- $from : string|null
- $includeTotals : bool|null
- $page : int|null
- $perPage : int|null
- $take : int|null
- Number of results per page for checkpoint pagination.
Methods
- __construct() : mixed
- PaginatedRequest constructor.
- build() : array<string|int, int|string>
- Return an array representing the paginated request.
- getFrom() : string|null
- Retrieve the `from` for the checkpoint-paginated request.
- getIncludeTotals() : bool|null
- Retrieve the `include_totals` for the paginated request.
- getPage() : int|null
- Retrieve the `page` for the paginated request.
- getPerPage() : int|null
- Retrieve the `per_page` for the paginated request.
- getTake() : int|null
- Retrieve the `take` for the checkpoint-paginated request.
- setFrom() : self
- Set the `from` for the checkpoint-paginated request.
- setIncludeTotals() : self
- Set the `include_totals` for the paginated request.
- setPage() : self
- Set the `page` for the paginated request.
- setPerPage() : self
- Set the `per_page` for the paginated request.
- setTake() : self
- Set the `take` for the paginated request.
Properties
$from
private
string|null
$from
= null
$includeTotals
private
bool|null
$includeTotals
= null
$page
private
int|null
$page
= null
$perPage
private
int|null
$perPage
= null
$take
Number of results per page for checkpoint pagination.
private
int|null
$take
= null
Methods
__construct()
PaginatedRequest constructor.
public
__construct([null|int $page = null ][, null|int $perPage = null ][, null|bool $includeTotals = null ][, null|string $from = null ]) : mixed
Parameters
- $page : null|int = null
-
Page index of the results to return. First page is 0.
- $perPage : null|int = null
-
Number of results per page. Paging is disabled if parameter not set.
- $includeTotals : null|bool = null
-
Return results inside an object that contains the total result count (true) or as a direct array of results (false, default)
- $from : null|string = null
-
Checkpoint pagination parameter. ID of the last item in the previous page.
build()
Return an array representing the paginated request.
public
build() : array<string|int, int|string>
Return values
array<string|int, int|string>getFrom()
Retrieve the `from` for the checkpoint-paginated request.
public
getFrom() : string|null
Return values
string|nullgetIncludeTotals()
Retrieve the `include_totals` for the paginated request.
public
getIncludeTotals() : bool|null
Return values
bool|nullgetPage()
Retrieve the `page` for the paginated request.
public
getPage() : int|null
Return values
int|nullgetPerPage()
Retrieve the `per_page` for the paginated request.
public
getPerPage() : int|null
Return values
int|nullgetTake()
Retrieve the `take` for the checkpoint-paginated request.
public
getTake() : int|null
Return values
int|nullsetFrom()
Set the `from` for the checkpoint-paginated request.
public
setFrom(string $from) : self
Parameters
- $from : string
-
value of
fromparameter for the checkpoint-paginated request
Return values
selfsetIncludeTotals()
Set the `include_totals` for the paginated request.
public
setIncludeTotals(bool|null $includeTotals) : self
Parameters
- $includeTotals : bool|null
-
value of
include_totalsparameter for the paginated request
Return values
selfsetPage()
Set the `page` for the paginated request.
public
setPage(int $page) : self
Parameters
- $page : int
-
value of
pageparameter for the paginated request
Return values
selfsetPerPage()
Set the `per_page` for the paginated request.
public
setPerPage(int $perPage) : self
Parameters
- $perPage : int
-
value of
per_pageparameter for the paginated request
Return values
selfsetTake()
Set the `take` for the paginated request.
public
setTake(int $take) : self
Parameters
- $take : int
-
value of
takeparameter for the checkpoint-paginated request