Method |
Description |
|
beforeFormat ( Report $report, DataTable $table ) : boolean |
Executed before formatting all metrics for a report. Implementers can return false
to skip formatting this metric and can use this method to access information needed for
formatting (for example, the site ID). |
|
format ( mixed $value, Piwik\Metrics\Formatter $formatter ) : mixed |
Returns a formatted metric value. This value is what appears in API output. From within Piwik,
(core & plugins) the computed value is used. Only when outputting to the API does a metric
get formatted. |
|
getActualMetricColumn ( DataTable $table, string $columnName, int[] | null $mappingNameToId = null ) : string |
Helper method that determines the actual column for a metric in a {@link Piwik\DataTable}. |
|
getDocumentation ( ) : string |
Returns a string describing what the metric represents. The result will be included in report metadata
API output, including processed reports. |
|
getMetric ( Row | array $row, string $columnName, int[] | null $mappingNameToId = null ) : mixed |
Helper method that will access a metric in a {@link Piwik\DataTable\Row} or array either by
its name or by its special numerical index value. |
|
getMetricValues ( DataTable $table, string $columnName, int[] | null $mappingNameToId = null ) : array |
Helper method that will determine the actual column name for a metric in a
{@link Piwik\DataTable} and return every column value for this name. |
|
getName ( ) : string |
Returns the column name of this metric, eg, "nb_visits" or "avg_time_on_site". |
|
getTranslatedName ( ) : string |
Returns the human readable translated name of this metric, eg, "Visits" or "Avg. time on site". |
|