diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2009-03-30 06:22:03 +0400 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2009-03-30 06:22:03 +0400 |
commit | e0507d715f281f56e10d0b87dc4e013f3aba96c1 (patch) | |
tree | 6c7740e8e5dffaa4006b9208324a1952bac49469 /core/DataTable/Filter/ReplaceColumnNames.php | |
parent | 13158516543fd79913f4a5e1a393dc3d5bc1ab31 (diff) |
- fixing recently introduced sorting issue, refactoring, cleaning up the generic filters concept by removing the automatic sorting of data
- fixing issue when executing unit tests would invalidate tmp/cache/tracker files
- fixed edge case issue when calling several apis from one http request, and requesting recursive output, it was failing in some random cases
- adding a unit test that calls all callable api methods and check for non empty output
-
git-svn-id: http://dev.piwik.org/svn/trunk@1041 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, 10 insertions, 6 deletions
diff --git a/core/DataTable/Filter/ReplaceColumnNames.php b/core/DataTable/Filter/ReplaceColumnNames.php index 8d25c960ac..36c03da672 100644 --- a/core/DataTable/Filter/ReplaceColumnNames.php +++ b/core/DataTable/Filter/ReplaceColumnNames.php @@ -35,10 +35,11 @@ class Piwik_DataTable_Filter_ReplaceColumnNames extends Piwik_DataTable_Filter * OLD_COLUMN_NAME2 => NEW_COLUMN NAME2, * ) */ - public function __construct( $table, $mappingToApply = null ) + public function __construct( $table, $recursive = false, $mappingToApply = null ) { parent::__construct($table); $this->mappingToApply = Piwik_Archive::$mappingFromIdToName; + $this->applyFilterRecursively = $recursive; if(!is_null($mappingToApply)) { $this->mappingToApply = $mappingToApply; @@ -58,11 +59,14 @@ class Piwik_DataTable_Filter_ReplaceColumnNames extends Piwik_DataTable_Filter $oldColumns = $row->getColumns(); $newColumns = $this->getRenamedColumns($oldColumns); $row->setColumns( $newColumns ); - 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 + 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 + } } } } |