function EntityBase::getEntityType

Gets the entity type definition.

Return value

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

Overrides EntityInterface::getEntityType

5 calls to EntityBase::getEntityType()
ConfigEntityBase::toArray in core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
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
ContentEntityBase::wasDefaultRevision in core/lib/Drupal/Core/Entity/ContentEntityBase.php
EntityBase::createDuplicate in core/lib/Drupal/Core/Entity/EntityBase.php

File

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

Class

EntityBase
Defines a base entity class.

Namespace

Drupal\Core\Entity

Code

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

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