You are here

protected function SqlContentEntityStorageSchema::handleEntityTypeSchemaUpdateExceptionOnDataCopy in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::handleEntityTypeSchemaUpdateExceptionOnDataCopy()
  2. 9 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::handleEntityTypeSchemaUpdateExceptionOnDataCopy()

Handles the case when an error occurs during the data copying step.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The updated entity type definition.

\Drupal\Core\Entity\EntityTypeInterface $original: The original entity type definition.

array &$sandbox: The sandbox array from a hook_update_N() implementation.

Overrides SqlFieldableEntityTypeListenerTrait::handleEntityTypeSchemaUpdateExceptionOnDataCopy

File

core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php, line 654

Class

SqlContentEntityStorageSchema
Defines a schema handler that supports revisionable, translatable entities.

Namespace

Drupal\Core\Entity\Sql

Code

protected function handleEntityTypeSchemaUpdateExceptionOnDataCopy(EntityTypeInterface $entity_type, EntityTypeInterface $original, array &$sandbox) {

  // In case of an error during the save process, we need to clean up the
  // temporary tables.
  foreach ($sandbox['temporary_table_names'] as $table_name) {
    $this->database
      ->schema()
      ->dropTable($table_name);
  }
}