diff options
author | diosmosis <benaka@piwik.pro> | 2014-11-13 12:45:05 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2014-11-13 12:45:05 +0300 |
commit | e596b71231113941b43809e0adc9af608e797645 (patch) | |
tree | bbe492d166839be95976eed16c965786d9084f42 /core/Plugin/ProcessedMetric.php | |
parent | d07d24c59780587c58727a5295951a2dfcb8fc58 (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.php | 16 |
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 |