GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Data Fields
Entry_Sort Class Reference

If this file is called directly, abort. More...

Public Member Functions

 __construct (\GV\Field $field, $direction=self::ASC, $mode=self::ALPHA)
 Instantiate a sort for a field. More...
 
 to_sorting ()
 Return search_criteria-compatible array. More...
 

Data Fields

 $direction
 
 $field
 
 $mode
 
const ALPHA = 'ALPHA'
 
const ASC = 'ASC'
 
const DESC = 'DESC'
 
const NUMERIC = 'NUMERIC'
 
const RAND = 'RAND'
 

Detailed Description

If this file is called directly, abort.

Entry sorting.

Definition at line 12 of file class-gv-collection-entry-sort.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \GV\Field  $field,
  $direction = self::ASC,
  $mode = self::ALPHA 
)

Instantiate a sort for a field.

Parameters
\GV\Field$fieldThe field we're sorting by.
string$directionThe direction of this sort (::ASC, ::DESC, etc.). Default: self::ASC.
string$modeThe sort mode (self::NUMERIC). Default: self::ALPHA.
Since
2.0
Returns
An instance of this class, pass to ::sort()

Definition at line 66 of file class-gv-collection-entry-sort.php.

References $field.

Member Function Documentation

◆ to_sorting()

to_sorting ( )

Return search_criteria-compatible array.

Returns
array [key, direction, is_numeric]

Definition at line 77 of file class-gv-collection-entry-sort.php.

Field Documentation

◆ $direction

$direction

Definition at line 47 of file class-gv-collection-entry-sort.php.

◆ $field

$field

Definition at line 42 of file class-gv-collection-entry-sort.php.

◆ $mode

$mode

Definition at line 52 of file class-gv-collection-entry-sort.php.

◆ ALPHA

const ALPHA = 'ALPHA'

Definition at line 37 of file class-gv-collection-entry-sort.php.

◆ ASC

const ASC = 'ASC'

Definition at line 17 of file class-gv-collection-entry-sort.php.

Referenced by gvfield\callback(), and View\get_entries().

◆ DESC

const DESC = 'DESC'

Definition at line 22 of file class-gv-collection-entry-sort.php.

Referenced by gvfield\callback(), and View\get_entries().

◆ NUMERIC

const NUMERIC = 'NUMERIC'

Definition at line 32 of file class-gv-collection-entry-sort.php.

Referenced by gvfield\callback().

◆ RAND

const RAND = 'RAND'

Definition at line 27 of file class-gv-collection-entry-sort.php.

Referenced by gvfield\callback().


The documentation for this class was generated from the following file: