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-06 22:00:10 +0300
committerdiosmosis <benaka@piwik.pro>2014-11-07 04:49:22 +0300
commitc1264ec0476fc2e88c29d052e2018990458f814d (patch)
tree148a599c6c1400df960a72fc1254f14e5f546582 /core/Metrics.php
parentd4e0c79caef3ca17dbad7890a52af9a000f07ee9 (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.php8
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;
}