diff options
author | diosmosis <benaka@piwik.pro> | 2014-11-07 00:01:09 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2014-11-07 04:49:22 +0300 |
commit | 1c921c50f28581e239133bce76dda0955bc11027 (patch) | |
tree | 21e0ca0457c8b972efc60d691bbe04b75fd6364d /core/Plugin/Metric.php | |
parent | c1264ec0476fc2e88c29d052e2018990458f814d (diff) |
Rewrite AddColumnsProcessedMetricsGoal filter to use processed metrics DataTable metadata.
Diffstat (limited to 'core/Plugin/Metric.php')
-rw-r--r-- | core/Plugin/Metric.php | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/core/Plugin/Metric.php b/core/Plugin/Metric.php index 3728dacac5..7a6033e8b7 100644 --- a/core/Plugin/Metric.php +++ b/core/Plugin/Metric.php @@ -63,17 +63,27 @@ abstract class Metric /** * TODO */ - public function getColumn(Row $row, $columnName, $mappingIdToName = null) + public function getColumn($row, $columnName, $mappingIdToName = null) { if (empty($mappingIdToName)) { $mappingIdToName = Metrics::getMappingFromNameToId(); } - $value = $row->getColumn($columnName); - if ($value === false - && isset($mappingIdToName[$columnName]) - ) { - $value = $row->getColumn($mappingIdToName[$columnName]); + if ($row instanceof Row) { + $value = $row->getColumn($columnName); + if ($value === false + && isset($mappingIdToName[$columnName]) + ) { + $value = $row->getColumn($mappingIdToName[$columnName]); + } + } else { + $value = $row[$columnName]; + if ($value === false + && isset($mappingIdToName[$columnName]) + ) { + $value = $row[$mappingIdToName[$columnName]]; + } + return $value; } return $value; |