diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2016-07-20 04:56:27 +0300 |
---|---|---|
committer | Matthieu Aubry <mattab@users.noreply.github.com> | 2016-07-20 04:56:27 +0300 |
commit | ef3e384b687d94f4f2612a5822b5b2ce05c296cf (patch) | |
tree | a7179d2614dc4abe4da344674242fb2a0ccea82f /core/DataTable | |
parent | 023d80496bf3cc02a7f6141243e55e3fb262c647 (diff) |
pass instance of both row objects to aggregate callback when aggregating them (#10330)
Diffstat (limited to 'core/DataTable')
-rw-r--r-- | core/DataTable/Row.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/DataTable/Row.php b/core/DataTable/Row.php index 0adccdbc60..a2299b6ac7 100644 --- a/core/DataTable/Row.php +++ b/core/DataTable/Row.php @@ -477,7 +477,7 @@ class Row implements \ArrayAccess, \IteratorAggregate throw new Exception("Unknown aggregation operation for column $columnToSumName."); } - $newValue = $this->getColumnValuesMerged($operation, $thisColumnValue, $columnToSumValue); + $newValue = $this->getColumnValuesMerged($operation, $thisColumnValue, $columnToSumValue, $this, $rowToSum); $this->setColumn($columnToSumName, $newValue); } @@ -489,7 +489,7 @@ class Row implements \ArrayAccess, \IteratorAggregate /** */ - private function getColumnValuesMerged($operation, $thisColumnValue, $columnToSumValue) + private function getColumnValuesMerged($operation, $thisColumnValue, $columnToSumValue, $thisRow, $rowToSum) { switch ($operation) { case 'skip': @@ -525,7 +525,7 @@ class Row implements \ArrayAccess, \IteratorAggregate break; default: if (is_callable($operation)) { - return call_user_func($operation, $thisColumnValue, $columnToSumValue); + return call_user_func($operation, $thisColumnValue, $columnToSumValue, $thisRow, $rowToSum); } throw new Exception("Unknown operation '$operation'."); @@ -556,7 +556,7 @@ class Row implements \ArrayAccess, \IteratorAggregate continue; } - $aggregatedMetadata[$columnn] = $this->getColumnValuesMerged($operation, $thisMetadata, $sumMetadata); + $aggregatedMetadata[$columnn] = $this->getColumnValuesMerged($operation, $thisMetadata, $sumMetadata, $this, $rowToSum); } } |