Piwik\DataTable\Filter\

AddSummaryRow

Adds a summary row to DataTables that contains the sum of all other table rows.

Basic usage example

$dataTable->filter('AddSummaryRow');

// use a human readable label for the summary row (instead of '-1')
$dataTable->filter('AddSummaryRow', array($labelSummaryRow = Matomo (formerly Piwik)::translate('General_Total')));

Methods

The class defines the following methods:

__construct()

Constructor.

Signature

  • It accepts the following parameter(s):
    • $table (DataTable) — The table that will be filtered.
    • $labelSummaryRow (int) — The value of the label column for the new row.

filter()

Executes the filter.

See AddSummaryRow.

Signature

  • It accepts the following parameter(s):

  • It does not return anything.

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.

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.