diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-07-21 12:01:35 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-07-21 12:01:36 +0400 |
commit | aca8ec33a85e0a70b818b6227145041717d7a69e (patch) | |
tree | 41377e3a9737d63222522ef93ecf8483f3faddfa /core/DataTable/Filter/ReplaceColumnNames.php | |
parent | 0a63210e3eae7562af1a3dbee340eb1ee140db3d (diff) |
Refs #4059 Work in progress: Conversion to use Namespaces: Period*, Metrics, Segment, SegmentExpression, PluginsManager.
Removed some deprecated code.
Diffstat (limited to 'core/DataTable/Filter/ReplaceColumnNames.php')
-rw-r--r-- | core/DataTable/Filter/ReplaceColumnNames.php | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/core/DataTable/Filter/ReplaceColumnNames.php b/core/DataTable/Filter/ReplaceColumnNames.php index c2b2beca79..abf802b82a 100644 --- a/core/DataTable/Filter/ReplaceColumnNames.php +++ b/core/DataTable/Filter/ReplaceColumnNames.php @@ -8,8 +8,14 @@ * @category Piwik * @package Piwik */ +namespace Piwik\DataTable\Filter; + +use Piwik\DataTable\Filter; +use Piwik\DataTable\Simple; use Piwik\Metrics; use Piwik\Piwik; +use Piwik\DataTable; +use Piwik_Tracker_GoalManager; /** * This filter replaces column names using a mapping table that maps from the old name to the new name. @@ -24,14 +30,14 @@ use Piwik\Piwik; * You can specify the mapping array to apply in the constructor. * * @package Piwik - * @subpackage Piwik_DataTable + * @subpackage DataTable */ -class Piwik_DataTable_Filter_ReplaceColumnNames extends Piwik_DataTable_Filter +class ReplaceColumnNames extends Filter { protected $mappingToApply; /** - * @param Piwik_DataTable $table Table + * @param DataTable $table Table * @param array $mappingToApply Mapping to apply. Must have the format * array( OLD_COLUMN_NAME => NEW_COLUMN NAME, * OLD_COLUMN_NAME2 => NEW_COLUMN NAME2, @@ -49,11 +55,11 @@ class Piwik_DataTable_Filter_ReplaceColumnNames extends Piwik_DataTable_Filter /** * Executes the filter and renames the defined columns * - * @param Piwik_DataTable $table + * @param DataTable $table */ public function filter($table) { - if($table instanceof Piwik_DataTable_Simple) { + if ($table instanceof Simple) { $this->filterSimple($table); } else { $this->filterTable($table); @@ -70,13 +76,13 @@ class Piwik_DataTable_Filter_ReplaceColumnNames extends Piwik_DataTable_Filter } } - protected function filterSimple(Piwik_DataTable_Simple $table) + protected function filterSimple(Simple $table) { foreach ($table->getRows() as $row) { - $columns = array_keys( $row->getColumns() ); - foreach($columns as $column) { + $columns = array_keys($row->getColumns()); + foreach ($columns as $column) { $newName = $this->getRenamedColumn($column); - if($newName) { + if ($newName) { $row->renameColumn($column, $newName); } } |