You are here

public function EntityDefinitionUpdateManager::getEntityType in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php \Drupal\Core\Entity\EntityDefinitionUpdateManager::getEntityType()

Returns an entity type definition ready to be manipulated.

When needing to apply updates to existing entity type definitions, this method should always be used to retrieve a definition ready to be manipulated.

Parameters

string $entity_type_id: The entity type identifier.

Return value

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

Overrides EntityDefinitionUpdateManagerInterface::getEntityType

1 call to EntityDefinitionUpdateManager::getEntityType()
EntityDefinitionUpdateManager::updateEntityType in core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php
Applies any change performed to the passed entity type definition.

File

core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php, line 131
Contains \Drupal\Core\Entity\EntityDefinitionUpdateManager.

Class

EntityDefinitionUpdateManager
Manages entity definition updates.

Namespace

Drupal\Core\Entity

Code

public function getEntityType($entity_type_id) {
  $entity_type = $this->entityManager
    ->getLastInstalledDefinition($entity_type_id);
  return $entity_type ? clone $entity_type : NULL;
}