Piwik\DataTable\Filter\
Execute a callback for each row of a DataTable passing certain column values and metadata as metadata, and replaces row metadata with the callback result.
Basic usage example
$dataTable->filter('MetadataCallbackReplace', array('url', function ($url) {
return $url . '#index';
}));
The class defines the following methods:
__construct()
— Constructor.filter()
ash; See ColumnCallbackReplace. Inherited from ColumnCallbackReplace
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
) —
$metadataToFilter
(array
|string
) —
The metadata whose values should be passed to the callback and then replaced with the callback's result.
$functionToApply
(callable
) —
The function to execute. Must take the column value as a parameter and return a value that will be used to replace the original.$functionParameters
(array
|null
) —
deprecated - use an anonymous function instead.$extraColumnParameters
(array
) —
Extra column values that should be passed to the callback, but shouldn't be replaced.filter()
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.