SortBuilder
in package
implements
BuilderInterface
Builder for making sorted list queries.
Tags
Table of Contents
Interfaces
Properties
- $isAscending : bool
- $sortKey : string|null
Methods
- __construct() : void
- Builder for including sort by field data in a list request.
- asc() : void
- Alias for ascending().
- ascending() : void
- Add a sort by the field in ascending order.
- build() : string
- Builds the query string parameters from the Builder.
- desc() : void
- Alias for descending().
- descending() : void
- Add a sort by the field in descending order.
Properties
$isAscending
public
bool
$isAscending
$sortKey
public
string|null
$sortKey
Methods
__construct()
Builder for including sort by field data in a list request.
public
__construct() : void
asc()
Alias for ascending().
public
asc(string $key) : void
Parameters
- $key : string
-
The field for the resource list to be sorted by.
ascending()
Add a sort by the field in ascending order.
public
ascending(string $key) : void
Parameters
- $key : string
-
The field for the resource list to be sorted by.
build()
Builds the query string parameters from the Builder.
public
build([string $resourceName = null ]) : string
Parameters
- $resourceName : string = null
-
The type of resource to generate the query string for. Eg. AccountingResource, ProjectsResource
Return values
string —The built query string
desc()
Alias for descending().
public
desc(string $key) : void
Parameters
- $key : string
-
The field for the resource list to be sorted by.
descending()
Add a sort by the field in descending order.
public
descending(string $key) : void
Parameters
- $key : string
-
The field for the resource list to be sorted by.