Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public function resolve(AttributeValueInterface $attributeValue) |
||
23 | { |
||
24 | $value = $attributeValue->getValue(); |
||
25 | |||
26 | if (AttributeValueInterface::STORAGE_JSON === $attributeValue->getType()) { |
||
27 | return json_encode($value); |
||
28 | } |
||
29 | |||
30 | if (AttributeValueInterface::STORAGE_TEXT === $attributeValue->getType()) { |
||
31 | return strtolower(str_replace([' ', '-'], '_', $value)); |
||
32 | } |
||
33 | |||
34 | return $value; |
||
35 | } |
||
37 |