diff options
author | diosmosis <benaka@piwik.pro> | 2014-11-17 10:07:17 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2014-11-17 10:07:17 +0300 |
commit | 8676a94a9bc5544a759012520d0150a65fed6cc4 (patch) | |
tree | 8f06a141d9c9b9919f3de78627ec7ee5beccb1e8 /core/Plugin/Metric.php | |
parent | c39566965b4b9371e619e11cb8346a9a11f8b246 (diff) |
Move format metrics logic from processor to Metrics\Formatter and fix Overlay UI tests by formatting manually w/ an Html Formatter.
Diffstat (limited to 'core/Plugin/Metric.php')
-rw-r--r-- | core/Plugin/Metric.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/Plugin/Metric.php b/core/Plugin/Metric.php index 6a906bee44..9542d18933 100644 --- a/core/Plugin/Metric.php +++ b/core/Plugin/Metric.php @@ -83,6 +83,20 @@ abstract class Metric } /** + * 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). + * + * @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; + } + + /** * 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. * |