PrepareSort uses trait:short
Table of Contents
Constants
- SORT_DEFAULT = 'sortDefault'
- The 'sortDefault' parameter.
Properties
- $sortDefault : string|null
- The default sort definition.
Methods
- initializeSortDefault() : static
- Initialize the sort behavior with an associative array definition.
- prepareSort() : string|null
- Prepares the sorting parameter based on the given request and arguments.
Constants
SORT_DEFAULT
The 'sortDefault' parameter.
public
mixed
SORT_DEFAULT
= 'sortDefault'
Properties
$sortDefault
The default sort definition.
public
string|null
$sortDefault
= null
Methods
initializeSortDefault()
Initialize the sort behavior with an associative array definition.
public
initializeSortDefault([array<string|int, mixed> $init = [] ][, string|null $defaultValue = null ]) : static
Parameters
- $init : array<string|int, mixed> = []
- $defaultValue : string|null = null
Return values
staticprepareSort()
Prepares the sorting parameter based on the given request and arguments.
protected
prepareSort(ServerRequestInterface|null $request[, array<string|int, mixed> $args = [] ][, array<string|int, mixed>|null &$params = null ][, string|null $default = null ][, string $name = ControllerParam::SORT ]) : string|null
Parameters
- $request : ServerRequestInterface|null
-
The request object, which may contain a sorting parameter.
- $args : array<string|int, mixed> = []
-
An associative array of arguments, which may include a predefined sorting value.
- $params : array<string|int, mixed>|null = null
-
A reference to an array where the resolved sorting parameter will be stored.
- $default : string|null = null
- $name : string = ControllerParam::SORT
Return values
string|null —The resolved sorting parameter or the default sorting value if none is provided.