public function EntityWrapper::getValue

Overrides \Drupal\Core\TypedData\TypedData::getValue().

Overrides TypedData::getValue

7 calls to EntityWrapper::getValue()
EntityWrapper::get in drupal/core/lib/Drupal/Core/Entity/Field/Type/EntityWrapper.php
Implements \Drupal\Core\TypedData\ComplexDataInterface::get().
EntityWrapper::getIterator in drupal/core/lib/Drupal/Core/Entity/Field/Type/EntityWrapper.php
Implements \IteratorAggregate::getIterator().
EntityWrapper::getProperties in drupal/core/lib/Drupal/Core/Entity/Field/Type/EntityWrapper.php
Implements \Drupal\Core\TypedData\ComplexDataInterface::getProperties().
EntityWrapper::getPropertyValues in drupal/core/lib/Drupal/Core/Entity/Field/Type/EntityWrapper.php
Implements \Drupal\Core\TypedData\ComplexDataInterface::getPropertyValues().
EntityWrapper::getString in drupal/core/lib/Drupal/Core/Entity/Field/Type/EntityWrapper.php
Overrides \Drupal\Core\TypedData\TypedData::getString().

... See full list

File

drupal/core/lib/Drupal/Core/Entity/Field/Type/EntityWrapper.php, line 72
Contains \Drupal\Core\Entity\Field\Type\EntityWrapper.

Class

EntityWrapper
Defines an 'entity' data type, e.g. the computed 'entity' property of entity references.

Namespace

Drupal\Core\Entity\Field\Type

Code

public function getValue() {
  if (isset($this->newEntity)) {
    return $this->newEntity;
  }
  if (!empty($this->definition['settings']['id source'])) {
    $this->id = $this->parent
      ->__get($this->definition['settings']['id source']);
  }
  return $this->id ? entity_load($this->entityType, $this->id) : NULL;
}