BaseFilter
This documentation is for an outdated Matomo version.
Click here if you want to read this article for the latest version.
Click here if you want to read this article for the latest version.
Piwik\DataTable\
BaseFilter
A filter is set of logic that manipulates a DataTable.
- add/remove rows
- change column values (change string to lowercase, truncate, etc.)
- add/remove columns or metadata (compute percentage values, add an 'icon' metadata based on the label, etc.)
- add/remove/edit subtable associated with rows
- etc.
Filters are called with a DataTable instance and extra parameters that are specified in DataTable::filter() and DataTable::queueFilter().
To see examples of Filters look at the existing ones in the Piwik\DataTable\BaseFilter namespace.
Methods
The abstract class defines the following methods:
__construct()— Constructor.filter()— Manipulates a DataTable in some way.enableRecursive()— Enables/Disables recursive filtering.filterSubTable()— Filters a row's subtable, if one exists and is loaded in memory.
__construct()
Constructor.
Signature
- It accepts the following parameter(s):
$table(DataTable) —
filter()
Manipulates a DataTable in some way.
Signature
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.
Signature
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.
Signature
- It accepts the following parameter(s):
$row(Row) — The row whose subtable should be filter.
- It does not return anything or a mixed result.