Skip to main content

GV\Entry_Sort

Entry sorting.

Source: future/includes/class-gv-collection-entry-sort.php:12

Details

  • Kind: class
  • Namespace: GV

Properties

PropertyTypeDescription
$field\GV\FieldThe field that this sort is for.
$directionstringThe direction (see self::ASC, self::DESC).
$modestringThe sort mode (see self::NUMERIC, self::ALPHA).

Methods

MethodDescription
__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

NameTypeDefaultDescription
$field\GV\FieldThe field we're sorting by.
$directionstringself::ASCThe direction of this sort (\GV\Entry_Sort::ASC, \GV\Entry_Sort::DESC, etc.). Default: self::ASC.
$modestringself::ALPHAThe 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