PHP Class Piwik\DataTable\Filter\Sort

It is possible to specify a natural sorting (see php.net/natsort for details).
Inheritance: extends Piwik\DataTable\BaseFilter
Show file Open project: piwik/piwik Class Usage Examples

Protected Properties

Property Type Description
$columnToSort
$isSecondaryColumnSortEnabled
$naturalSort
$order

Public Methods

Method Description
__construct ( DataTable $table, string $columnToSort, string $order = 'desc', boolean $naturalSort = true, boolean $recursiveSort = true, boolean $doSortBySecondaryColumn = false ) Constructor.
filter ( DataTable $table ) : mixed See {@link Sort}.

Private Methods

Method Description
sort ( Sorter $sorter, DataTable $table )

Method Details

__construct() public method

Constructor.
public __construct ( DataTable $table, string $columnToSort, string $order = 'desc', boolean $naturalSort = true, boolean $recursiveSort = true, boolean $doSortBySecondaryColumn = false )
$table Piwik\DataTable The table to eventually filter.
$columnToSort string The name of the column to sort by.
$order string order `'asc'` or `'desc'`.
$naturalSort boolean Whether to use a natural sort or not (see {@link http://php.net/natsort}).
$recursiveSort boolean Whether to sort all subtables or not.
$doSortBySecondaryColumn boolean If true will sort by a secondary column. The column is automatically detected and will be either nb_visits or label, if possible.

filter() public method

See {@link Sort}.
public filter ( DataTable $table ) : mixed
$table Piwik\DataTable
return mixed

Property Details

$columnToSort protected property

protected $columnToSort

$isSecondaryColumnSortEnabled protected property

protected $isSecondaryColumnSortEnabled

$naturalSort protected property

protected $naturalSort

$order protected property

protected $order