Piwik\DataTable\Filter\
Executes a callback for each row of a DataTable and adds the result as a new row metadata value.
Basic usage example
$dataTable->filter('ColumnCallbackAddMetadata', array('label', 'logo', 'Piwik\Plugins\MyPlugin\getLogoFromLabel'));
The class defines the following methods:
__construct() — Constructor.filter() ash; See ColumnCallbackAddMetadata.enableRecursive() ash; Enables/Disables recursive filtering. Inherited from BaseFilterfilterSubTable() 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) —
$columnsToRead (string|array) —
The columns to read from each row and pass on to the callback.
$metadataToAdd (string) —
The name of the metadata field that will be added to each row.$functionToApply (callable) —
The callback to apply for each row.$functionParameters (array) —
deprecated - use an anonymous function instead.$applyToSummaryRow (bool) —
Whether the callback should be applied to the summary row or not.filter()See ColumnCallbackAddMetadata.
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.