Piwik\Plugins\VisitFrequency\Columns\Metrics\

ReturningMetric

Processed metric for VisitFrequency.get API method which just copies VisitsSummary.get metrics as differently named metrics.

This metric must be supplied in order to ensure correct formatting for processed metrics that are copied from VisitsSummary.get.

Methods

The class defines the following methods:

compute()

Computes the metric using the values in a Row.

The computed value should be numerical and not formatted in any way. For example, for a percent value, 0.14 should be returned instead of "14%".

Signature

  • It accepts the following parameter(s):

    • $row (Row) —
  • It returns a mixed value.

getDependentMetrics()

Returns the array of metrics that are necessary for computing this metric.

The elements of the array are metric names.

Signature

  • It returns a string[] value.

getTemporaryMetrics()

Returns the array of metrics that are necessary for computing this metric, but should not be displayed to the user unless explicitly requested.

These metrics are intermediate metrics that are not really valuable to the user. On a request, if showColumns or hideColumns is not used, they will be removed automatically.

Signature

  • It returns a string[] value.

beforeCompute()

Executed before computing all processed metrics for a report.

Implementers can return false to skip computing this metric.

Signature

  • It accepts the following parameter(s):

  • Returns: bool — Return true to compute the metric for the table, false to skip computing this metric.