($data, $filter)
| 465 | } |
| 466 | |
| 467 | private function aggregateData($data, $filter) { |
| 468 | $options = json_decode($filter, true); |
| 469 | if (!is_array($options)) { |
| 470 | $options = []; |
| 471 | } |
| 472 | |
| 473 | $header = isset($data['header']) && is_array($data['header']) ? $data['header'] : []; |
| 474 | $dimensionCount = max(count($header) - 1, 0); |
| 475 | $hiddenDrilldownIndices = $this->getHiddenDrilldownIndices($options, $dimensionCount); |
| 476 | if (!empty($hiddenDrilldownIndices)) { |
| 477 | $data = $this->removeColumnsByIndex($data, $hiddenDrilldownIndices); |
| 478 | } |
| 479 | |
| 480 | if (!$this->shouldAggregate($options)) { |
| 481 | return $data; |
| 482 | } |
| 483 | |
| 484 | return $this->aggregateRows($data); |
| 485 | } |
| 486 | |
| 487 | private function normalizeFilterOptionsForData($filterOptions, array $header): string { |
| 488 | if (!is_string($filterOptions) || trim($filterOptions) === '') { |
no test coverage detected