diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2011-03-23 04:59:57 +0300 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2011-03-23 04:59:57 +0300 |
commit | 66164854e74551aadc222c423f2edc88593b81b8 (patch) | |
tree | 3903f86d8ec94b207a1b60ef5113a7fd85df15dc /core/DataTable/Filter/ReplaceColumnNames.php | |
parent | ea66910a54d1c9933cb3b96f0bcfcfdf8a69ec55 (diff) |
Refs #2218 Thanks for the tip Anthon, it helped me see the light...
Now the filter object itself will take care of applying recursively when the table was recursively loaded indeed.
Leaving open until I can check that all occurences on demo are fixed
git-svn-id: http://dev.piwik.org/svn/trunk@4169 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/DataTable/Filter/ReplaceColumnNames.php')
-rw-r--r-- | core/DataTable/Filter/ReplaceColumnNames.php | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/core/DataTable/Filter/ReplaceColumnNames.php b/core/DataTable/Filter/ReplaceColumnNames.php index 5213dba3f8..2d22de7046 100644 --- a/core/DataTable/Filter/ReplaceColumnNames.php +++ b/core/DataTable/Filter/ReplaceColumnNames.php @@ -36,29 +36,24 @@ class Piwik_DataTable_Filter_ReplaceColumnNames extends Piwik_DataTable_Filter * OLD_COLUMN_NAME2 => NEW_COLUMN NAME2, * ) */ - public function __construct( $table, $recursive = false, $mappingToApply = null ) + public function __construct( $table, $mappingToApply = null ) { parent::__construct($table); $this->mappingToApply = Piwik_Archive::$mappingFromIdToName; - $this->applyFilterRecursively = $recursive; if(!is_null($mappingToApply)) { $this->mappingToApply = $mappingToApply; } - $this->filter($table); } - protected function filter($table) + public function filter($table) { foreach($table->getRows() as $key => $row) { $oldColumns = $row->getColumns(); $newColumns = $this->getRenamedColumns($oldColumns); $row->setColumns( $newColumns ); - if($this->applyFilterRecursively) - { - $this->filterSubTable($row); - } + $this->filterSubTable($row); } } |