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/AddSummaryRow.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/AddSummaryRow.php')
-rw-r--r-- | core/DataTable/Filter/AddSummaryRow.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/DataTable/Filter/AddSummaryRow.php b/core/DataTable/Filter/AddSummaryRow.php index 0dc8307852..21698edbd8 100644 --- a/core/DataTable/Filter/AddSummaryRow.php +++ b/core/DataTable/Filter/AddSummaryRow.php @@ -40,24 +40,24 @@ class Piwik_DataTable_Filter_AddSummaryRow extends Piwik_DataTable_Filter if($table->getRowsCount() > $startRowToSummarize + 1) { - $this->filter(); + $this->filter($table); } } - protected function filter() + protected function filter($table) { - $this->table->filter('Sort', + $table->filter('Sort', array( $this->columnToSortByBeforeTruncating, 'desc')); - $rows = $this->table->getRows(); - $count = $this->table->getRowsCount(); + $rows = $table->getRows(); + $count = $table->getRowsCount(); $newRow = new Piwik_DataTable_Row(); for($i = $this->startRowToSummarize; $i < $count; $i++) { if(!isset($rows[$i])) { // case when the last row is a summary row, it is not indexed by $cout but by Piwik_DataTable::ID_SUMMARY_ROW - $summaryRow = $this->table->getRowFromId(Piwik_DataTable::ID_SUMMARY_ROW); + $summaryRow = $table->getRowFromId(Piwik_DataTable::ID_SUMMARY_ROW); $newRow->sumRow($summaryRow); } else @@ -67,8 +67,8 @@ class Piwik_DataTable_Filter_AddSummaryRow extends Piwik_DataTable_Filter } $newRow->setColumns(array('label' => $this->labelSummaryRow) + $newRow->getColumns()); - $this->table->filter('Limit', array(0, $this->startRowToSummarize)); - $this->table->addSummaryRow($newRow); + $table->filter('Limit', array(0, $this->startRowToSummarize)); + $table->addSummaryRow($newRow); unset($rows); } } |