protected function MenuLinkStorageController::postDelete

Overrides DatabaseStorageController::postDelete().

Overrides DatabaseStorageController::postDelete

File

drupal/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php, line 350
Contains \Drupal\menu_link\MenuLinkStorageController.

Class

MenuLinkStorageController
Controller class for menu links.

Namespace

Drupal\menu_link

Code

protected function postDelete($entities) {
  $affected_menus = array();

  // Update the has_children status of the parent.
  foreach ($entities as $entity) {
    if (!$this->preventReparenting) {
      $this
        ->updateParentalStatus($entity);
    }

    // Store all menu names for which we need to clear the cache.
    if (!isset($affected_menus[$entity->menu_name])) {
      $affected_menus[$entity->menu_name] = $entity->menu_name;
    }
  }
  foreach ($affected_menus as $menu_name) {
    menu_cache_clear($menu_name);
  }
  _menu_clear_page_cache();
}