function SqlContentEntityStorage::doDeleteFieldItems

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::doDeleteFieldItems()
  2. 8.9.x core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::doDeleteFieldItems()
  3. 10 core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php \Drupal\Core\Entity\Sql\SqlContentEntityStorage::doDeleteFieldItems()

Overrides ContentEntityStorageBase::doDeleteFieldItems

File

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

Class

SqlContentEntityStorage
A content entity database storage implementation.

Namespace

Drupal\Core\Entity\Sql

Code

protected function doDeleteFieldItems($entities) {
    $ids = array_keys($entities);
    $this->database
        ->delete($this->baseTable)
        ->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);
    }
}

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