diff options
author | diosmosis <benaka@piwik.pro> | 2014-11-06 22:00:10 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2014-11-07 04:49:22 +0300 |
commit | c1264ec0476fc2e88c29d052e2018990458f814d (patch) | |
tree | 148a599c6c1400df960a72fc1254f14e5f546582 /core/Metrics.php | |
parent | d4e0c79caef3ca17dbad7890a52af9a000f07ee9 (diff) |
Moved processed metrics computation to DataTableGenericFilter, removed new filters & implemented as methods in Report to avoid confusion regarding re-use, allow adding processed metrics as DataTable metadata and use this to rewrite AddProcessedMetrics filter, correct name of Metrics::getMappingFromIdToName function, added placeholder AggregatedMetric class for future, revise Metric/ProcessedMetric hierarchy (add methods for translation/etc.), allow .get API methods to use metadata to automatically figure out which columns to select, get EcommerceOrderWithItemsTest to pass.
Diffstat (limited to 'core/Metrics.php')
-rw-r--r-- | core/Metrics.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/Metrics.php b/core/Metrics.php index 0f8baf5a10..01e2e66ca2 100644 --- a/core/Metrics.php +++ b/core/Metrics.php @@ -183,10 +183,12 @@ class Metrics return $names; } - // TODO: this method is named wrong - public static function getMappingFromIdToName() + public static function getMappingFromNameToId() { - $idToName = array_flip(self::$mappingFromIdToName); + static $idToName = null; + if ($idToName === null) { + $idToName = array_flip(self::$mappingFromIdToName); + } return $idToName; } |