You are here

public function EntityDefinitionUpdateManager::getEntityType in Drupal 9

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|null The entity type definition. Or NULL if not found.

Overrides EntityDefinitionUpdateManagerInterface::getEntityType

2 calls to EntityDefinitionUpdateManager::getEntityType()
EntityDefinitionUpdateManager::updateEntityType in core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php
Applies any change performed to the passed entity type definition.
EntityDefinitionUpdateManager::updateFieldableEntityType in core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php
Applies any change performed to a fieldable entity type definition.

File

core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php, line 133

Class

EntityDefinitionUpdateManager
Manages entity definition updates.

Namespace

Drupal\Core\Entity

Code

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