function EntityLastInstalledSchemaRepositoryInterface::getLastInstalledDefinitions

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/EntityLastInstalledSchemaRepositoryInterface.php \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface::getLastInstalledDefinitions()
  2. 10 core/lib/Drupal/Core/Entity/EntityLastInstalledSchemaRepositoryInterface.php \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface::getLastInstalledDefinitions()
  3. 11.x core/lib/Drupal/Core/Entity/EntityLastInstalledSchemaRepositoryInterface.php \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface::getLastInstalledDefinitions()

Gets the entity type definitions in their most recently installed state.

During the application lifetime, entity type definitions can change. For example, updated code can be deployed. The \Drupal\Core\Entity\EntityTypeManagerInterface::getDefinitions() method will always return the definitions as determined by the current codebase. This method returns the definitions from the last time that a \Drupal\Core\Entity\EntityTypeListener event was completed. In other words, the definitions that the entity type's handlers have incorporated into the application state. For example, if the entity type's storage handler is SQL-based, the definition for which database tables were created.

Application management code can check if \Drupal\Core\Entity\EntityTypeManagerInterface::getDefinitions() differs from getLastInstalledDefinitions() and decide whether to:

Return value

\Drupal\Core\Entity\EntityTypeInterface[] An array containing the installed definition for all entity types, keyed by the entity type ID.

1 method overrides EntityLastInstalledSchemaRepositoryInterface::getLastInstalledDefinitions()
EntityLastInstalledSchemaRepository::getLastInstalledDefinitions in core/lib/Drupal/Core/Entity/EntityLastInstalledSchemaRepository.php
Gets the entity type definitions in their most recently installed state.

File

core/lib/Drupal/Core/Entity/EntityLastInstalledSchemaRepositoryInterface.php, line 70

Class

EntityLastInstalledSchemaRepositoryInterface
Provides an interface for an installed entity definition repository.

Namespace

Drupal\Core\Entity

Code

public function getLastInstalledDefinitions();

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