Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public static function aggregateByObject(array $resources, ResourceConfigurator $configurator): array |
||
18 | { |
||
19 | $result = []; |
||
20 | foreach ($resources as $resource) { |
||
21 | $resourceModel = $resource->buildResourceModel($configurator); |
||
22 | $object = [ |
||
23 | 'type' => $resource->type, |
||
24 | ]; |
||
25 | $object['amount'] = $resourceModel->decorator()->displayAmountWithUnit(); |
||
26 | $result[$resource['object_id']][$resource['type']] = $object; |
||
27 | } |
||
28 | |||
29 | return $result; |
||
30 | } |
||
31 | |||
52 |