Piwik\Columns\

MetricsList

Manages the global list of metrics that can be used in reports.

Metrics are added automatically by dimensions as well as through the Metric.addMetrics and Metric.addComputedMetrics and filtered through the Metric.filterMetrics event. Observers for this event should call the addMetric() method to add metrics or use any of the other methods to remove metrics.

Methods

The class defines the following methods:

addMetric()

Signature

  • It accepts the following parameter(s):

  • It does not return anything.

getMetrics()

Get all available metrics.

Signature

remove()

Removes one or more metrics from the metrics list.

Signature

  • It accepts the following parameter(s):
    • $metricCategory (string) — The metric category id. Can be a translation token eg 'General_Visits' see Metric::getCategory().
    • $metricName (string|Piwik\Columns\false) — The name of the metric to remove eg 'nb_visits'. If not supplied, all metrics within that category will be removed.
  • It does not return anything.

getMetric()

Signature

  • It accepts the following parameter(s):

    • $metricName (string) —
  • Returns: Metric|Piwik\Plugin\ArchivedMetric|null