public function DynamicEntityReferenceItem::getValue in Dynamic Entity Reference 8.2
Same name and namespace in other branches
- 8 src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php \Drupal\dynamic_entity_reference\Plugin\Field\FieldType\DynamicEntityReferenceItem::getValue()
Gets the data value.
Return value
mixed The data value.
Overrides EntityReferenceItem::getValue
File
- src/
Plugin/ Field/ FieldType/ DynamicEntityReferenceItem.php, line 462
Class
- DynamicEntityReferenceItem
- Defines the 'dynamic_entity_reference' entity field type.
Namespace
Drupal\dynamic_entity_reference\Plugin\Field\FieldTypeCode
public function getValue() {
$values = parent::getValue();
if (!empty($values['target_type'])) {
$this
->get('entity')
->getTargetDefinition()
->setEntityTypeId($values['target_type']);
}
return $values;
}