public function EntityTypeManager::getActiveDefinition in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::getActiveDefinition()
Gets the active definition for a content entity type.
@internal
Parameters
string $entity_type_id: The entity type ID.
Return value
\Drupal\Core\Entity\EntityTypeInterface The active entity type definition.
File
- core/
lib/ Drupal/ Core/ Entity/ EntityTypeManager.php, line 157
Class
- EntityTypeManager
- Manages entity type plugin definitions.
Namespace
Drupal\Core\EntityCode
public function getActiveDefinition($entity_type_id) {
$definition = $this->entityLastInstalledSchemaRepository
->getLastInstalledDefinition($entity_type_id);
return $definition ?: $this
->getDefinition($entity_type_id);
}