Piwik\DataTable\Filter\
Truncates a DataTable by merging all rows after a certain index into a new summary row.
The ReplaceSummaryRowLabel filter will be queued after the table is truncated.
Basic usage
$dataTable->filter('Truncate', [$truncateAfter = 500]);
Using a custom summary row label
$dataTable->filter('Truncate', [$truncateAfter = 500, $summaryRowLabel = Piwik::translate('General_Total')]);
The class defines the following methods:
__construct() — Constructor.filter() ash; Executes the filter, see Truncate.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) —
$truncateAfter (int) —
The row index to truncate at. All rows passed this index will be removed.
$labelSummaryRow (string) —
The label to use for the summary row. Defaults to Piwik::translate('General_Others').$columnToSortByBeforeTruncating (string) —
The column to sort by before truncation, eg, 'nb_visits'.$filterRecursive (bool) —
If true executes this filter on all subtables descending from $table.filter()Executes the filter, see Truncate.
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.