diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2011-01-17 05:19:39 +0300 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2011-01-17 05:19:39 +0300 |
commit | 295c67416d54188033f65e040a06c4ef98a061e0 (patch) | |
tree | 7b307fbf23e4c10f96c66c8d04e705b0f2b10f75 /core/DataTable/Filter/ReplaceColumnNames.php | |
parent | 0bc09f2bcabf9da976a522cf69c3369ecd1bc308 (diff) |
Fixes #173 - making all filters recursive by default (no performance impact since it won't load the tables if they were not loaded in the API). Updating all filters to reflect new abstract class signature
git-svn-id: http://dev.piwik.org/svn/trunk@3764 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/DataTable/Filter/ReplaceColumnNames.php')
-rw-r--r-- | core/DataTable/Filter/ReplaceColumnNames.php | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/core/DataTable/Filter/ReplaceColumnNames.php b/core/DataTable/Filter/ReplaceColumnNames.php index 90b4e62a32..5213dba3f8 100644 --- a/core/DataTable/Filter/ReplaceColumnNames.php +++ b/core/DataTable/Filter/ReplaceColumnNames.php @@ -45,15 +45,10 @@ class Piwik_DataTable_Filter_ReplaceColumnNames extends Piwik_DataTable_Filter { $this->mappingToApply = $mappingToApply; } - $this->filter(); + $this->filter($table); } - protected function filter() - { - $this->filterTable($this->table); - } - - protected function filterTable($table) + protected function filter($table) { foreach($table->getRows() as $key => $row) { @@ -62,12 +57,7 @@ class Piwik_DataTable_Filter_ReplaceColumnNames extends Piwik_DataTable_Filter $row->setColumns( $newColumns ); if($this->applyFilterRecursively) { - try { - $subTable = Piwik_DataTable_Manager::getInstance()->getTable( $row->getIdSubDataTable() ); - $this->filterTable($subTable); - } catch(Exception $e){ - // case idSubTable == null, or if the table is not loaded in memory - } + $this->filterSubTable($row); } } } |