From b08b9295293668eb17aa21639bae932e915633cb Mon Sep 17 00:00:00 2001 From: mattab Date: Fri, 27 Feb 2015 16:02:08 +1300 Subject: Fixes #7310 - remove unused code & logic --- core/ArchiveProcessor.php | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) (limited to 'core/ArchiveProcessor.php') diff --git a/core/ArchiveProcessor.php b/core/ArchiveProcessor.php index 17716000e8..a8254259e8 100644 --- a/core/ArchiveProcessor.php +++ b/core/ArchiveProcessor.php @@ -214,14 +214,9 @@ class ArchiveProcessor $table = $this->aggregateDataTableRecord($recordName, $columnsAggregationOperation, $columnsToRenameAfterAggregation); - $rowsCount = $table->getRowsCount(); - $nameToCount[$recordName]['level0'] = $rowsCount; + $nameToCount[$recordName]['level0'] = $table->getRowsCount(); - $rowsCountRecursive = $rowsCount; - if ($this->isAggregateSubTables()) { - $rowsCountRecursive = $table->getRowsCountRecursive(); - } - $nameToCount[$recordName]['recursive'] = $rowsCountRecursive; + $nameToCount[$recordName]['recursive'] = $table->getRowsCountRecursive(); $blob = $table->getSerialized($maximumRowsInDataTableLevelZero, $maximumRowsInSubDataTable, $columnToSortByBeforeTruncation); Common::destroy($table); @@ -346,14 +341,8 @@ class ArchiveProcessor */ protected function aggregateDataTableRecord($name, $columnsAggregationOperation = null, $columnsToRenameAfterAggregation = null) { - if ($this->isAggregateSubTables()) { - // By default we shall aggregate all sub-tables. - $dataTable = $this->getArchive()->getDataTableExpanded($name, $idSubTable = null, $depth = null, $addMetadataSubtableId = false); - } else { - // In some cases (eg. Actions plugin when period=range), - // for better performance we will only aggregate the parent table - $dataTable = $this->getArchive()->getDataTable($name, $idSubTable = null); - } + // By default we shall aggregate all sub-tables. + $dataTable = $this->getArchive()->getDataTableExpanded($name, $idSubTable = null, $depth = null, $addMetadataSubtableId = false); if ($dataTable instanceof Map) { // see https://github.com/piwik/piwik/issues/4377 @@ -471,7 +460,7 @@ class ArchiveProcessor // as $date => $tableToSum $this->aggregatedDataTableMapsAsOne($data, $table); } else { - $table->addDataTable($data, $this->isAggregateSubTables()); + $table->addDataTable($data); } return $table; @@ -488,7 +477,7 @@ class ArchiveProcessor if ($tableToAggregate instanceof Map) { $this->aggregatedDataTableMapsAsOne($tableToAggregate, $aggregated); } else { - $aggregated->addDataTable($tableToAggregate, $this->isAggregateSubTables()); + $aggregated->addDataTable($tableToAggregate); } } } @@ -504,7 +493,7 @@ class ArchiveProcessor } foreach ($columnsToRenameAfterAggregation as $oldName => $newName) { - $table->renameColumn($oldName, $newName, $this->isAggregateSubTables()); + $table->renameColumn($oldName, $newName); } } @@ -540,12 +529,4 @@ class ArchiveProcessor return $metrics; } - - /** - * @return bool - */ - protected function isAggregateSubTables() - { - return !$this->getParams()->isSkipAggregationOfSubTables(); - } } -- cgit v1.2.3