PrepareLimit uses trait:short, trait:short
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 limit value.
- $pagination : Pagination|null
- The pagination definition.
Methods
- initializePagination() : static
- Initializes the `pagination` property.
- initializeLimit() : static
- Initialize the min/max limit range.
- prepareLimit() : int
- Prepare and returns the 'limit' value.
- prepareOffset() : int
- Prepare and returns the 'offset' value.
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 limit value.
public
int|null
$offset
= null
$pagination
The pagination definition.
public
Pagination|null
$pagination
= null
Methods
initializePagination()
Initializes the `pagination` property.
public
initializePagination([array<string|int, mixed> $init = [] ][, ContainerInterface|null $container = null ]) : static
This method retrieves the default pagination settings for the application, either from the provided initialization array or from the dependency injection container.
Parameters
- $init : array<string|int, mixed> = []
-
Optional initialization array (e.g., ['pagination' => Pagination instance]).
- $container : ContainerInterface|null = null
-
Optional DI container for retrieving the App instance.
Tags
Return values
static —Returns the current controller instance for method chaining.
initializeLimit()
Initialize the min/max limit range.
protected
initializeLimit([array<string|int, mixed> $init = [] ]) : static
Parameters
- $init : array<string|int, mixed> = []
Return values
staticprepareLimit()
Prepare and returns the 'limit' value.
protected
prepareLimit(ServerRequestInterface|null $request[, array<string|int, mixed> $args = [] ][, array<string|int, mixed>|null &$params = null ][, int $defaultValue = 0 ][, string $property = Pagination::LIMIT ]) : int
Parameters
- $request : ServerRequestInterface|null
- $args : array<string|int, mixed> = []
- $params : array<string|int, mixed>|null = null
- $defaultValue : int = 0
- $property : string = Pagination::LIMIT
Return values
intprepareOffset()
Prepare and returns the 'offset' value.
protected
prepareOffset(ServerRequestInterface|null $request[, array<string|int, mixed> $args = [] ][, array<string|int, mixed>|null &$params = null ][, int $defaultValue = 0 ]) : int
Parameters
- $request : ServerRequestInterface|null
- $args : array<string|int, mixed> = []
- $params : array<string|int, mixed>|null = null
- $defaultValue : int = 0