You are here

public function ContentEntityStorageTrait::delete in Multiversion 8.2

Same name and namespace in other branches
  1. 8 src/Entity/Storage/ContentEntityStorageTrait.php \Drupal\multiversion\Entity\Storage\ContentEntityStorageTrait::delete()
4 calls to ContentEntityStorageTrait::delete()
CommentStorage::delete in src/Entity/Storage/Sql/CommentStorage.php
Deletes permanently saved entities.
MenuLinkContentStorage::delete in src/Entity/Storage/Sql/MenuLinkContentStorage.php
Deletes permanently saved entities.
NodeStorage::delete in src/Entity/Storage/Sql/NodeStorage.php
@todo: {@link https://www.drupal.org/node/2597534 Figure out why we need this}, core seems to solve it some other way.
TermStorage::delete in src/Entity/Storage/Sql/TermStorage.php
Deletes permanently saved entities.
1 method overrides ContentEntityStorageTrait::delete()
MenuLinkContentStorage::delete in src/Entity/Storage/Sql/MenuLinkContentStorage.php
Deletes permanently saved entities.

File

src/Entity/Storage/ContentEntityStorageTrait.php, line 460

Class

ContentEntityStorageTrait

Namespace

Drupal\multiversion\Entity\Storage

Code

public function delete(array $entities) {

  // Entities are always "deleted" as new revisions when using a Multiversion
  // storage handler.
  $ids = [];
  foreach ($entities as $entity) {
    $ids[] = $entity
      ->id();
    $entity->_deleted->value = TRUE;
    $this
      ->save($entity);
  }

  // Reset the static cache for the "deleted" entities.
  $this
    ->resetCache($ids);
}