| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 30 | public function hashToFieldValue($fieldValue, array $context = array()) |
||
| 31 | { |
||
| 32 | if ($fieldValue === null) { |
||
| 33 | return new CountryValue(); |
||
| 34 | } |
||
| 35 | |||
| 36 | if (is_string($fieldValue)) { |
||
| 37 | $fieldValue = array($fieldValue); |
||
| 38 | } |
||
| 39 | |||
| 40 | $contentType = $this->contentTypeService->loadContentTypeByIdentifier($context['contentTypeIdentifier']); |
||
| 41 | $field = $contentType->getFieldDefinition($context['fieldIdentifier']); |
||
| 42 | $fieldType = $this->fieldTypeService->getFieldType($field->fieldTypeIdentifier); |
||
| 43 | |||
| 44 | return $fieldType->fromHash($fieldValue); |
||
| 45 | } |
||
| 47 |