You are here

public function EntityReferenceRevisionsItem::getValue in Entity Reference Revisions 8

Gets the data value.

Return value

mixed The data value.

Overrides EntityReferenceItem::getValue

File

src/Plugin/Field/FieldType/EntityReferenceRevisionsItem.php, line 199

Class

EntityReferenceRevisionsItem
Defines the 'entity_reference_revisions' entity field type.

Namespace

Drupal\entity_reference_revisions\Plugin\Field\FieldType

Code

public function getValue() {
  $values = parent::getValue();
  if ($this->entity instanceof EntityNeedsSaveInterface && $this->entity
    ->needsSave()) {
    $values['entity'] = $this->entity;
  }
  return $values;
}