EntityDefinitionUpdateManagerInterface

Defines an interface for managing entity definition updates. During the application lifetime, the definitions of various entity types and their data components (e.g., fields for fieldable entity types) can change. For example, updated code can be deployed. Some entity handlers may need to perform complex or long-running logic in response to the change. For example, a SQL-based storage handler may need to update the database schema. To support this, \Drupal\Core\Entity\EntityManagerInterface has

EntityDefinitionUpdateManager::__construct

public EntityDefinitionUpdateManager::__construct(EntityManagerInterface $entity_manager) Constructs a new EntityDefinitionUpdateManager. Parameters \Drupal\Core\Entity\EntityManagerInterface $entity_manager: The entity manager. File core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php, line 30 Class EntityDefinitionUpdateManager Manages entity definition updates. Namespace Drupal\Core\Entity Code public function __construct(EntityManagerInterface $entity_manager) { $this-&

EntityDefinitionUpdateManager::updateFieldStorageDefinition

public EntityDefinitionUpdateManager::updateFieldStorageDefinition(FieldStorageDefinitionInterface $storage_definition) Applies any change performed to the passed field storage definition. Parameters \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition: The field storage definition. Overrides EntityDefinitionUpdateManagerInterface::updateFieldStorageDefinition File core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php, line 183 Class EntityDefinitionUpdateManager

EntityDefinitionUpdateManager::updateEntityType

public EntityDefinitionUpdateManager::updateEntityType(EntityTypeInterface $entity_type) Applies any change performed to the passed entity type definition. Parameters \Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type definition. Overrides EntityDefinitionUpdateManagerInterface::updateEntityType File core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php, line 141 Class EntityDefinitionUpdateManager Manages entity definition updates. Namespace Drupal\Core\Enti

EntityDefinitionUpdateManager::uninstallFieldStorageDefinition

public EntityDefinitionUpdateManager::uninstallFieldStorageDefinition(FieldStorageDefinitionInterface $storage_definition) Uninstalls a field storage definition. Parameters \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition: The field storage definition. Overrides EntityDefinitionUpdateManagerInterface::uninstallFieldStorageDefinition File core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php, line 192 Class EntityDefinitionUpdateManager Manages entity definiti

EntityDefinitionUpdateManager::uninstallEntityType

public EntityDefinitionUpdateManager::uninstallEntityType(EntityTypeInterface $entity_type) Uninstalls an entity type definition. Parameters \Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type definition. Overrides EntityDefinitionUpdateManagerInterface::uninstallEntityType File core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php, line 150 Class EntityDefinitionUpdateManager Manages entity definition updates. Namespace Drupal\Core\Entity Code public functio

EntityDefinitionUpdateManager::requiresFieldStorageSchemaChanges

protected EntityDefinitionUpdateManager::requiresFieldStorageSchemaChanges(FieldStorageDefinitionInterface $storage_definition, FieldStorageDefinitionInterface $original) Checks if the changes to the storage definition requires schema changes. Parameters \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition: The updated field storage definition. \Drupal\Core\Field\FieldStorageDefinitionInterface $original: The original field storage definition. Return value bool TRUE if stora

EntityDefinitionUpdateManager::requiresEntityStorageSchemaChanges

protected EntityDefinitionUpdateManager::requiresEntityStorageSchemaChanges(EntityTypeInterface $entity_type, EntityTypeInterface $original) Checks if the changes to the entity type requires storage schema changes. Parameters \Drupal\Core\Entity\EntityTypeInterface $entity_type: The updated entity type definition. \Drupal\Core\Entity\EntityTypeInterface $original: The original entity type definition. Return value bool TRUE if storage schema changes are required, FALSE otherwise. File core/lib

EntityDefinitionUpdateManager::needsUpdates

public EntityDefinitionUpdateManager::needsUpdates() Checks if there are any definition updates that need to be applied. Return value bool TRUE if updates are needed. Overrides EntityDefinitionUpdateManagerInterface::needsUpdates File core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php, line 37 Class EntityDefinitionUpdateManager Manages entity definition updates. Namespace Drupal\Core\Entity Code public function needsUpdates() { return (bool) $this->getChangeList(); }

EntityDefinitionUpdateManager::installFieldStorageDefinition

public EntityDefinitionUpdateManager::installFieldStorageDefinition($name, $entity_type_id, $provider, FieldStorageDefinitionInterface $storage_definition) Installs a new field storage definition. Parameters string $name: The field storage definition name. string $entity_type_id: The target entity type identifier. string $provider: The name of the definition provider. \Drupal\Core\Field\FieldStorageDefinitionInterface $storage_definition: The field storage definition. Overrides EntityDefinitio