LimitTrait
Holds the limit/offset pagination bounds of a controller.
This trait exposes the default limit and offset values together with the
minLimit/maxLimit range used to clamp the page size requested by a client.
Tags
Table of Contents
Properties
- $limit : int|null
- The default limit value.
- $maxLimit : int|null
- The maximum limit value.
- $minLimit : int|null
- The minimum limit value.
- $offset : int|null
- The default offset value.
Methods
- initializeLimit() : static
- Initializes the limit, offset and min/max limit range from an array.
Properties
$limit
The default limit value.
public
int|null
$limit
= null
$maxLimit
The maximum limit value.
public
int|null
$maxLimit
= null
$minLimit
The minimum limit value.
public
int|null
$minLimit
= null
$offset
The default offset value.
public
int|null
$offset
= null
Methods
initializeLimit()
Initializes the limit, offset and min/max limit range from an array.
public
initializeLimit([array<string|int, mixed> $init = [] ]) : static
Parameters
- $init : array<string|int, mixed> = []
-
Initialization array, read from the Pagination keys (LIMIT, MAX_LIMIT, MIN_LIMIT, OFFSET).
Return values
static —Returns the current instance for method chaining.