You are here

public function EntityBase::getEntityType in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityBase.php \Drupal\Core\Entity\EntityBase::getEntityType()
  2. 10 core/lib/Drupal/Core/Entity/EntityBase.php \Drupal\Core\Entity\EntityBase::getEntityType()

Gets the entity type definition.

Return value

\Drupal\Core\Entity\EntityTypeInterface The entity type definition.

Overrides EntityInterface::getEntityType

7 calls to EntityBase::getEntityType()
ConfigEntityBase::toArray in core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
Gets an array of all property values.
ConfigEntityBundleBase::preSave in core/lib/Drupal/Core/Config/Entity/ConfigEntityBundleBase.php
Acts on an entity before the presave hook is invoked.
ContentEntityBase::createDuplicate in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Creates a duplicate of the entity.
ContentEntityBase::label in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Gets the label of the entity.
ContentEntityBase::wasDefaultRevision in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Checks whether the entity object was a default revision when it was saved.

... See full list

File

core/lib/Drupal/Core/Entity/EntityBase.php, line 427

Class

EntityBase
Defines a base entity class.

Namespace

Drupal\Core\Entity

Code

public function getEntityType() {
  return $this
    ->entityTypeManager()
    ->getDefinition($this
    ->getEntityTypeId());
}