SqlContentEntityStorage::doDeleteFieldItems

protected SqlContentEntityStorage::doDeleteFieldItems($entities)

Deletes entity field values from the storage.

Parameters

\Drupal\Core\Entity\ContentEntityInterface[] $entities: An array of entity objects to be deleted.

Overrides ContentEntityStorageBase::doDeleteFieldItems

File

core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php, line 725

Class

SqlContentEntityStorage
A content entity database storage implementation.

Namespace

Drupal\Core\Entity\Sql

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
protected function doDeleteFieldItems($entities) {
  $ids = array_keys($entities);
 
  $this->database->delete($this->entityType->getBaseTable())
    ->condition($this->idKey, $ids, 'IN')
    ->execute();
 
  if ($this->revisionTable) {
    $this->database->delete($this->revisionTable)
      ->condition($this->idKey, $ids, 'IN')
      ->execute();
  }
 
  if ($this->dataTable) {
    $this->database->delete($this->dataTable)
      ->condition($this->idKey, $ids, 'IN')
      ->execute();
  }
 
  if ($this->revisionDataTable) {
    $this->database->delete($this->revisionDataTable)
      ->condition($this->idKey, $ids, 'IN')
      ->execute();
  }
 
  foreach ($entities as $entity) {
    $this->deleteFromDedicatedTables($entity);
  }
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.