function FieldItemBase::getEntity

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

Overrides FieldItemInterface::getEntity

7 calls to FieldItemBase::getEntity()
ChangedItem::preSave in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/ChangedItem.php
DefaultLanguageItem::applyDefaultValue in core/modules/language/src/DefaultLanguageItem.php
FieldTestItem::postSave in core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/FieldTestItem.php
ListItemBase::getSettableOptions in core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php
PasswordItem::preSave in core/lib/Drupal/Core/Field/Plugin/Field/FieldType/PasswordItem.php

... See full list

File

core/lib/Drupal/Core/Field/FieldItemBase.php, line 60

Class

FieldItemBase
An entity field item.

Namespace

Drupal\Core\Field

Code

public function getEntity() {
    return $this->getParent()
        ->getEntity();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.