PrepareSort uses trait:short
Table of Contents
Properties
- $sortDefault : string|null
Methods
- initializeSort() : static
- Initialize the sort behavior with an associative array definition.
- prepareSort() : string|null
- Prepares the sorting parameter based on the given request and arguments.
Properties
$sortDefault
public
string|null
$sortDefault
= null
Methods
initializeSort()
Initialize the sort behavior with an associative array definition.
protected
initializeSort([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.