function EntityDefinitionUpdateManager::updateFieldableEntityType

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php \Drupal\Core\Entity\EntityDefinitionUpdateManager::updateFieldableEntityType()
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php \Drupal\Core\Entity\EntityDefinitionUpdateManager::updateFieldableEntityType()
  3. 10 core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php \Drupal\Core\Entity\EntityDefinitionUpdateManager::updateFieldableEntityType()

Overrides EntityDefinitionUpdateManagerInterface::updateFieldableEntityType

File

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

Class

EntityDefinitionUpdateManager
Manages entity definition updates.

Namespace

Drupal\Core\Entity

Code

public function updateFieldableEntityType(EntityTypeInterface $entity_type, array $field_storage_definitions, ?array &$sandbox = NULL) {
    $original = $this->getEntityType($entity_type->id());
    if ($this->requiresEntityDataMigration($entity_type, $original) && $sandbox === NULL) {
        throw new \InvalidArgumentException('The entity schema update for the ' . $entity_type->id() . ' entity type requires a data migration.');
    }
    $original_field_storage_definitions = $this->entityLastInstalledSchemaRepository
        ->getLastInstalledFieldStorageDefinitions($entity_type->id());
    $this->entityTypeListener
        ->onFieldableEntityTypeUpdate($entity_type, $original, $field_storage_definitions, $original_field_storage_definitions, $sandbox);
    $this->clearCachedDefinitions();
}

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