public function EntityWrapper::get

Implements ComplexDataInterface::get().

Overrides ComplexDataInterface::get

File

drupal/core/lib/Drupal/Core/Entity/Field/Type/EntityWrapper.php, line 145
Definition of 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 get($property_name) {
  $entity = $this
    ->getValue();

  // @todo: Allow navigating through the tree without data as well.
  return $entity ? $entity
    ->get($property_name) : NULL;
}