| Conditions | 4 |
| Paths | 6 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public static function aggregate(Collector $collector, array $saveKeys = []) |
||
| 25 | { |
||
| 26 | $idKey = $collector instanceof IdCollector ? $collector->getIdKey() : null; |
||
| 27 | |||
| 28 | $group = new AggregateGroup(); |
||
| 29 | foreach ($collector as $groupKey => $preAggregateGroup) { |
||
| 30 | $group->addAggregate($aggregate = new Aggregate($preAggregateGroup->getGroup())); |
||
| 31 | foreach ($preAggregateGroup as $preAggregate) { |
||
| 32 | Merger::merge($aggregate, $preAggregate, $saveKeys, $idKey); |
||
| 33 | } |
||
| 34 | Operator::operation($aggregate, $saveKeys); |
||
| 35 | } |
||
| 36 | |||
| 37 | return $group; |
||
| 38 | } |
||
| 39 | } |