FieldItemBase::getEntity

public FieldItemBase::getEntity()

Gets the entity that field belongs to.

Return value

\Drupal\Core\Entity\FieldableEntityInterface The entity object.

Overrides FieldItemInterface::getEntity

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();
}
doc_Drupal
2016-10-29 09:11:37
Comments
Leave a Comment

Please login to continue.