protected function SqlContentEntityStorage::deleteFromDedicatedTables in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::deleteFromDedicatedTables()
- 10 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::deleteFromDedicatedTables()
Deletes values of fields in dedicated tables for all revisions.
Parameters
\Drupal\Core\Entity\ContentEntityInterface $entity: The entity.
1 call to SqlContentEntityStorage::deleteFromDedicatedTables()
- SqlContentEntityStorage::doDeleteFieldItems in core/
lib/ Drupal/ Core/ Entity/ Sql/ SqlContentEntityStorage.php - Deletes entity field values from the storage.
File
- core/
lib/ Drupal/ Core/ Entity/ Sql/ SqlContentEntityStorage.php, line 1397
Class
- SqlContentEntityStorage
- A content entity database storage implementation.
Namespace
Drupal\Core\Entity\SqlCode
protected function deleteFromDedicatedTables(ContentEntityInterface $entity) {
$table_mapping = $this
->getTableMapping();
foreach ($this->fieldStorageDefinitions as $storage_definition) {
if (!$table_mapping
->requiresDedicatedTableStorage($storage_definition)) {
continue;
}
$table_name = $table_mapping
->getDedicatedDataTableName($storage_definition);
$revision_name = $table_mapping
->getDedicatedRevisionTableName($storage_definition);
$this->database
->delete($table_name)
->condition('entity_id', $entity
->id())
->execute();
if ($this->entityType
->isRevisionable()) {
$this->database
->delete($revision_name)
->condition('entity_id', $entity
->id())
->execute();
}
}
}