You are here

public function FieldItemListInterface::getEntity in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Field/FieldItemListInterface.php \Drupal\Core\Field\FieldItemListInterface::getEntity()
  2. 10 core/lib/Drupal/Core/Field/FieldItemListInterface.php \Drupal\Core\Field\FieldItemListInterface::getEntity()

Gets the entity that field belongs to.

Return value

\Drupal\Core\Entity\FieldableEntityInterface The entity object. If the entity is translatable and a specific translation is required, always request it by calling ::getTranslation() or ::getUntranslated() as the language of the returned object is not defined.

1 method overrides FieldItemListInterface::getEntity()
FieldItemList::getEntity in core/lib/Drupal/Core/Field/FieldItemList.php
Gets the entity that field belongs to.

File

core/lib/Drupal/Core/Field/FieldItemListInterface.php, line 39

Class

FieldItemListInterface
Interface for fields, being lists of field items.

Namespace

Drupal\Core\Field

Code

public function getEntity();