Conditions | 3 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public function normalize($group, $format = null, array $context = []) |
||
17 | { |
||
18 | /**@var Group $group * */ |
||
19 | $normalizedGroup = [ |
||
20 | 'code' => $group->getCode(), |
||
21 | 'type' => $group->getType()->getCode(), |
||
22 | |||
23 | ]; |
||
24 | foreach ($group->getTranslations() as $trans) { |
||
25 | $normalizedGroup['labels'][$trans->getLocale()] = $trans->getLabel( |
||
26 | ); |
||
27 | } |
||
28 | foreach ($group->getAttributes() as $attr) { |
||
29 | $normalizedGroup['attributes'][] = $attr->getCode(); |
||
30 | } |
||
31 | |||
32 | return $normalizedGroup; |
||
33 | } |
||
34 | |||
48 |