Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Field/FieldItemListInterface.php \Drupal\Core\Field\FieldItemListInterface::getEntity()
  2. 9 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();