You are here

public function PathPluginBase::remove in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/display/PathPluginBase.php \Drupal\views\Plugin\views\display\PathPluginBase::remove()

Reacts on deleting a display.

Overrides DisplayPluginBase::remove

File

core/modules/views/src/Plugin/views/display/PathPluginBase.php, line 566

Class

PathPluginBase
The base display plugin for path/callbacks. This is used for pages and feeds.

Namespace

Drupal\views\Plugin\views\display

Code

public function remove() {
  $menu_links = $this
    ->getMenuLinks();

  /** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */
  $menu_link_manager = \Drupal::service('plugin.manager.menu.link');
  foreach ($menu_links as $menu_link_id => $menu_link) {
    $menu_link_manager
      ->removeDefinition("views_view:{$menu_link_id}");
  }
}