function EntityReferenceItem::getValue
Same name in other branches
- 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::getValue()
- 8.9.x core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::getValue()
- 11.x core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::getValue()
File
-
core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldType/ EntityReferenceItem.php, line 272
Class
- EntityReferenceItem
- Defines the 'entity_reference' entity field type.
Namespace
Drupal\Core\Field\Plugin\Field\FieldTypeCode
public function getValue() {
$values = parent::getValue();
// If there is an unsaved entity, return it as part of the field item values
// to ensure idempotency of getValue() / setValue().
if ($this->hasNewEntity()) {
$values['entity'] = $this->entity;
}
return $values;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.