GV\Entry_Sort
Entry sorting.
Source: future/includes/class-gv-collection-entry-sort.php:12
Details
- Kind:
class - Namespace:
GV
Properties
| Property | Type | Description |
|---|---|---|
$field | \GV\Field | The field that this sort is for. |
$direction | string | The direction (see self::ASC, self::DESC). |
$mode | string | The sort mode (see self::NUMERIC, self::ALPHA). |
Methods
| Method | Description |
|---|---|
__construct() | Instantiate a sort for a field. |
to_sorting() | Return search_criteria-compatible array. |
Method Reference
__construct()
public function __construct( \GV\Field $field, $direction=self::ASC, $mode=self::ALPHA )
Instantiate a sort for a field.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | \GV\Field | The field we're sorting by. | |
$direction | string | self::ASC | The direction of this sort (\GV\Entry_Sort::ASC, \GV\Entry_Sort::DESC, etc.). Default: self::ASC. |
$mode | string | self::ALPHA | The sort mode (self::NUMERIC). Default: self::ALPHA. |
Returns
- \GV\Entry_Sort — An instance of this class, pass to \GV\Entry_Collection::sort()
Since: 2.0
Source: future/includes/class-gv-collection-entry-sort.php:66
to_sorting()
public function to_sorting()
Return search_criteria-compatible array.
Returns
array— [key,direction,is_numeric]
Source: future/includes/class-gv-collection-entry-sort.php:77