Piwik\DataTable\Filter\
Sorts a DataTable based on the value of a specific column.
It is possible to specify a natural sorting (see php.net/natsort for details).
The class defines the following methods:
__construct()
— Constructor.filter()
ash; See Sort.enableRecursive()
ash; Enables/Disables recursive filtering. Inherited from BaseFilter
filterSubTable()
ash; Filters a row's subtable, if one exists and is loaded in memory. Inherited from BaseFilter
__construct()
Constructor.
It accepts the following parameter(s):
$table
(DataTable
) —
$columnToSort
(string
) —
The name of the column to sort by.
$order
(string
) —
order 'asc'
or 'desc'
.$naturalSort
(bool
) —
Whether to use a natural sort or not (see http://php.net/natsort).$recursiveSort
(bool
) —
Whether to sort all subtables or not.$doSortBySecondaryColumn
(bool
|Piwik\DataTable\Filter\callback
) —
If true will sort by a secondary column. The column is automatically detected and will be either nb_visits or label, if possible. If callback given it will sort by the column returned by the callback (if any) callback will be called with 2 parameters: primaryColumnToSort and tablefilter()
See Sort.
It accepts the following parameter(s):
$table
(DataTable
) —It does not return anything or a mixed result.
enableRecursive()
Enables/Disables recursive filtering. Whether this property is actually used is up to the derived BaseFilter class.
It accepts the following parameter(s):
$enable
(bool
) —It does not return anything or a mixed result.
filterSubTable()
Filters a row's subtable, if one exists and is loaded in memory.
$row
(Row
) —
The row whose subtable should be filter.