function EntityTypeManager::getActiveDefinition
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::getActiveDefinition()
- 8.9.x core/lib/Drupal/Core/Entity/EntityTypeManager.php \Drupal\Core\Entity\EntityTypeManager::getActiveDefinition()
- 11.x 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 156
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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.