diff options
author | Matthieu Aubry <matt@piwik.org> | 2015-03-19 04:40:52 +0300 |
---|---|---|
committer | Matthieu Aubry <matt@piwik.org> | 2015-03-19 04:40:52 +0300 |
commit | 5c8e3b26221edaf11b87914e981fe9f4578f2d20 (patch) | |
tree | fb38c5492f3e97cf88d38a02b027398be352b811 | |
parent | f1d275dbc713779817f2cb7c5fbe54c388e0e7eb (diff) | |
parent | 199b7fe84c7b4093112427dfde170a002cffbf91 (diff) |
Merge pull request #7476 from piwik/datatable_getrows_performanceimprovement
Use `getRowsWithoutSummaryRow` when iterating over subtables
-rw-r--r-- | core/DataTable.php | 8 | ||||
-rw-r--r-- | core/DataTable/Filter/Sort.php | 2 | ||||
-rw-r--r-- | core/DataTable/Filter/Truncate.php | 2 | ||||
-rw-r--r-- | plugins/Actions/DataTable/Filter/Actions.php | 2 | ||||
-rw-r--r-- | plugins/Referrers/DataTable/Filter/UrlsFromWebsiteId.php | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/core/DataTable.php b/core/DataTable.php index 96f136a158..2e94d5e89e 100644 --- a/core/DataTable.php +++ b/core/DataTable.php @@ -374,7 +374,7 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess usort($this->rows, $functionCallback); if ($this->isSortRecursiveEnabled()) { - foreach ($this->getRows() as $row) { + foreach ($this->getRowsWithoutSummaryRow() as $row) { $subTable = $row->getSubtable(); if ($subTable) { @@ -487,7 +487,7 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess */ public function filterSubtables($className, $parameters = array()) { - foreach ($this->getRows() as $row) { + foreach ($this->getRowsWithoutSummaryRow() as $row) { $subtable = $row->getSubtable(); if ($subtable) { $subtable->filter($className, $parameters); @@ -508,7 +508,7 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess */ public function queueFilterSubtables($className, $parameters = array()) { - foreach ($this->getRows() as $row) { + foreach ($this->getRowsWithoutSummaryRow() as $row) { $subtable = $row->getSubtable(); if ($subtable) { $subtable->queueFilter($className, $parameters); @@ -1601,7 +1601,7 @@ class DataTable implements DataTableInterface, \IteratorAggregate, \ArrayAccess public function mergeSubtables($labelColumn = false, $useMetadataColumn = false) { $result = new DataTable(); - foreach ($this->getRows() as $row) { + foreach ($this->getRowsWithoutSummaryRow() as $row) { $subtable = $row->getSubtable(); if ($subtable !== false) { $parentLabel = $row->getColumn('label'); diff --git a/core/DataTable/Filter/Sort.php b/core/DataTable/Filter/Sort.php index 3b11ec370c..53c21f526a 100644 --- a/core/DataTable/Filter/Sort.php +++ b/core/DataTable/Filter/Sort.php @@ -279,7 +279,7 @@ class Sort extends BaseFilter unset($sortedRows); if ($table->isSortRecursiveEnabled()) { - foreach ($table->getRows() as $row) { + foreach ($table->getRowsWithoutSummaryRow() as $row) { $subTable = $row->getSubtable(); if ($subTable) { diff --git a/core/DataTable/Filter/Truncate.php b/core/DataTable/Filter/Truncate.php index 04b4cef2a8..ec95811c50 100644 --- a/core/DataTable/Filter/Truncate.php +++ b/core/DataTable/Filter/Truncate.php @@ -77,7 +77,7 @@ class Truncate extends BaseFilter $table->queueFilter('ReplaceSummaryRowLabel', array($this->labelSummaryRow)); if ($this->filterRecursive) { - foreach ($table->getRows() as $row) { + foreach ($table->getRowsWithoutSummaryRow() as $row) { if ($row->isSubtableLoaded()) { $this->filter($row->getSubtable()); } diff --git a/plugins/Actions/DataTable/Filter/Actions.php b/plugins/Actions/DataTable/Filter/Actions.php index 71abe4190b..8d13311677 100644 --- a/plugins/Actions/DataTable/Filter/Actions.php +++ b/plugins/Actions/DataTable/Filter/Actions.php @@ -43,7 +43,7 @@ class Actions extends BaseFilter return urldecode($label); })); - foreach ($table->getRows() as $row) { + foreach ($table->getRowsWithoutSummaryRow() as $row) { $subtable = $row->getSubtable(); if ($subtable) { $this->filter($subtable); diff --git a/plugins/Referrers/DataTable/Filter/UrlsFromWebsiteId.php b/plugins/Referrers/DataTable/Filter/UrlsFromWebsiteId.php index c35d60b463..ff67c22e40 100644 --- a/plugins/Referrers/DataTable/Filter/UrlsFromWebsiteId.php +++ b/plugins/Referrers/DataTable/Filter/UrlsFromWebsiteId.php @@ -36,7 +36,7 @@ class UrlsFromWebsiteId extends BaseFilter })); $table->queueFilter('ColumnCallbackReplace', array('label', 'Piwik\Plugins\Referrers\getPathFromUrl')); - foreach ($table->getRows() as $row) { + foreach ($table->getRowsWithoutSummaryRow() as $row) { $subtable = $row->getSubtable(); if ($subtable) { $this->filter($subtable); |