| Conditions | 5 |
| Paths | 6 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | protected function getDerivativeDefinitionsFromFieldDefinition(FieldDefinitionInterface $fieldDefinition, array $basePluginDefinition) { |
||
| 15 | $fieldType = $fieldDefinition->getType(); |
||
| 16 | $entityTypeId = $fieldDefinition->getTargetEntityTypeId(); |
||
| 17 | |||
| 18 | $parents = []; |
||
| 19 | if (isset($basePluginDefinition['field_types']) && in_array($fieldType, $basePluginDefinition['field_types'])) { |
||
| 20 | $fieldName = $fieldDefinition->getName(); |
||
| 21 | $fieldBundle = $fieldDefinition->getTargetBundle() ?: ''; |
||
| 22 | $parents[] = StringHelper::camelCase('field', $entityTypeId, $fieldBundle, $fieldName); |
||
| 23 | } |
||
| 24 | |||
| 25 | if (!empty($parents)) { |
||
| 26 | $this->derivatives[$basePluginDefinition['id']] = [ |
||
| 27 | 'parents' => array_merge($parents, $basePluginDefinition['parents']), |
||
| 28 | ] + $basePluginDefinition; |
||
| 29 | } |
||
| 30 | |||
| 31 | return $this->derivatives; |
||
| 32 | } |
||
| 33 | } |