Same name and namespace in other branches
  1. 8.9.x core/modules/node/src/Entity/Node.php \Drupal\node\Entity\Node::postDelete()
  2. 9 core/modules/node/src/Entity/Node.php \Drupal\node\Entity\Node::postDelete()

Acts on deleted entities before the delete hook is invoked.

Used after the entities are deleted but before invoking the delete hook.

Parameters

\Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object.

\Drupal\Core\Entity\EntityInterface[] $entities: An array of entities.

Overrides EntityInterface::postDelete

File

core/modules/node/src/Entity/Node.php, line 179

Class

Node
Defines the node entity class.

Namespace

Drupal\node\Entity

Code

public static function postDelete(EntityStorageInterface $storage, array $nodes) {
  parent::postDelete($storage, $nodes);
  \Drupal::service('node.grant_storage')
    ->deleteNodeRecords(array_keys($nodes));
}