Piwik\DataTable\Filter\
DataTable filter that will group DataTable rows together based on the results of a reduce function.
NOTE: This filter should never be queued, it must be applied directly on a DataTable.
Basic usage example
// group URLs by host
$dataTable->filter('GroupBy', array('label', function ($labelUrl) {
return parse_url($labelUrl, PHP_URL_HOST);
}));
The class defines the following methods:
__construct()
— Constructor.filter()
ash; See GroupBy.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
) —
$groupByColumn
(string
) —
The column name to reduce.
$reduceFunction
(callable
) —
The reduce function. This must alter the $groupByColumn
column in some way. If not set then the filter will group by the raw column value.$parameters
(array
) —
deprecated - use an anonymous function instead.filter()
See GroupBy.
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.