function View::postDelete

Same name in other branches
  1. 9 core/modules/views/src/Entity/View.php \Drupal\views\Entity\View::postDelete()
  2. 8.9.x core/modules/views/src/Entity/View.php \Drupal\views\Entity\View::postDelete()
  3. 10 core/modules/views/src/Entity/View.php \Drupal\views\Entity\View::postDelete()

Overrides EntityBase::postDelete

File

core/modules/views/src/Entity/View.php, line 417

Class

View
Defines a View configuration entity class.

Namespace

Drupal\views\Entity

Code

public static function postDelete(EntityStorageInterface $storage, array $entities) {
    parent::postDelete($storage, $entities);
    $tempstore = \Drupal::service('tempstore.shared')->get('views');
    foreach ($entities as $entity) {
        $tempstore->delete($entity->id());
    }
    views_invalidate_cache();
}

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