diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-11-18 05:19:52 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-11-18 05:19:52 +0400 |
commit | 7d265b52271f7bf2ee305dc627fa11454684021b (patch) | |
tree | 6fdd50829d0b6a60c7e27d925cf95c2c24fcb8c9 /core/Archive | |
parent | 884e22d596b4b5be15fc6e33bb2403f021bfeb58 (diff) |
Using refactored const
Diffstat (limited to 'core/Archive')
-rw-r--r-- | core/Archive/DataCollection.php | 8 | ||||
-rw-r--r-- | core/Archive/DataTableFactory.php | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/core/Archive/DataCollection.php b/core/Archive/DataCollection.php index 29b4dab96e..557aa44408 100644 --- a/core/Archive/DataCollection.php +++ b/core/Archive/DataCollection.php @@ -296,9 +296,9 @@ class DataCollection if (!empty($metadataNamesToIndexBy)) { $metadataName = array_shift($metadataNamesToIndexBy); - if ($metadataName == 'site') { + if ($metadataName == DataTableFactory::TABLE_METADATA_SITE_INDEX) { $indexKeyValues = array_values($this->sitesId); - } else if ($metadataName == 'period') { + } else if ($metadataName == DataTableFactory::TABLE_METADATA_PERIOD_INDEX) { $indexKeyValues = array_keys($this->periods); } @@ -318,9 +318,9 @@ class DataCollection $currentLevel = & $index; foreach ($metadataNamesToIndexBy as $metadataName) { - if ($metadataName == 'site') { + if ($metadataName == DataTableFactory::TABLE_METADATA_SITE_INDEX) { $key = $idSite; - } else if ($metadataName == 'period') { + } else if ($metadataName == DataTableFactory::TABLE_METADATA_PERIOD_INDEX) { $key = $period; } else { $key = $row[self::METADATA_CONTAINER_ROW_KEY][$metadataName]; diff --git a/core/Archive/DataTableFactory.php b/core/Archive/DataTableFactory.php index a053c6b09c..166cfcc7d3 100644 --- a/core/Archive/DataTableFactory.php +++ b/core/Archive/DataTableFactory.php @@ -310,13 +310,13 @@ class DataTableFactory $result = $table; } - if (!isset($keyMetadata['site'])) { - $keyMetadata['site'] = reset($this->sitesId); + if (!isset($keyMetadata[DataTableFactory::TABLE_METADATA_SITE_INDEX])) { + $keyMetadata[DataTableFactory::TABLE_METADATA_SITE_INDEX] = reset($this->sitesId); } - if (!isset($keyMetadata['period'])) { + if (!isset($keyMetadata[DataTableFactory::TABLE_METADATA_PERIOD_INDEX])) { reset($this->periods); - $keyMetadata['period'] = key($this->periods); + $keyMetadata[DataTableFactory::TABLE_METADATA_PERIOD_INDEX] = key($this->periods); } // Note: $result can be a DataTable\Map @@ -400,7 +400,7 @@ class DataTableFactory */ private function prettifyIndexLabel($labelType, $label) { - if ($labelType == 'period') { // prettify period labels + if ($labelType == self::TABLE_METADATA_PERIOD_INDEX) { // prettify period labels return $this->periods[$label]->getPrettyString(); } return $label; |