You are here

function views_view_delete in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/views.module \views_view_delete()
  2. 10 core/modules/views/views.module \views_view_delete()

Implements hook_ENTITY_TYPE_delete().

File

core/modules/views/views.module, line 835
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_view_delete(EntityInterface $entity) {

  // Rebuild the routes in case there is a routed display.
  $executable = Views::executableFactory()
    ->get($entity);
  $executable
    ->initDisplay();
  foreach ($executable->displayHandlers as $display) {
    if ($display
      ->getRoutedDisplay()) {
      \Drupal::service('router.builder')
        ->setRebuildNeeded();
      break;
    }
  }
}