Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <benaka@piwik.pro>2014-11-13 12:45:05 +0300
committerdiosmosis <benaka@piwik.pro>2014-11-13 12:45:05 +0300
commite596b71231113941b43809e0adc9af608e797645 (patch)
treebbe492d166839be95976eed16c965786d9084f42 /core/Plugin/ProcessedMetric.php
parentd07d24c59780587c58727a5295951a2dfcb8fc58 (diff)
Move goal translations and metric docs to metric classes from Goals visualization. Allow these values as defaults for translations in visualizations, and fix a bug in GoalsTable where sort was improperly applied if no data was in the data table. Also include in-memory caching for Goals.getGoals API method.
Diffstat (limited to 'core/Plugin/ProcessedMetric.php')
-rw-r--r--core/Plugin/ProcessedMetric.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/core/Plugin/ProcessedMetric.php b/core/Plugin/ProcessedMetric.php
index db638dfb0f..e4ddc378a1 100644
--- a/core/Plugin/ProcessedMetric.php
+++ b/core/Plugin/ProcessedMetric.php
@@ -19,7 +19,7 @@ use Piwik\DataTable\Row;
abstract class ProcessedMetric extends Metric
{
/**
- * The sub-namespace name in a plugin where Report components are stored.
+ * The sub-namespace name in a plugin where ProcessedMetrics are stored.
*/
const COMPONENT_SUBNAMESPACE = 'Metrics';
@@ -54,4 +54,18 @@ abstract class ProcessedMetric extends Metric
{
return true;
}
+
+ /**
+ * Executed before formatting all processed 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).
+ *
+ * @param Report $report
+ * @param DataTable $table
+ * @return bool Return `true` to format the metric for the table, `false` to skip formatting.
+ */
+ public function beforeFormat($report, DataTable $table)
+ {
+ return true;
+ }
} \ No newline at end of file