protected MenuLinkManager::deleteInstance(MenuLinkInterface $instance, $persist)
Deletes a specific instance.
Parameters
\Drupal\Core\Menu\MenuLinkInterface $instance: The plugin instance to be deleted.
bool $persist: If TRUE, calls MenuLinkInterface::deleteLink() on the instance.
Throws
\Drupal\Component\Plugin\Exception\PluginException If the plugin instance does not support deletion.
File
- core/lib/Drupal/Core/Menu/MenuLinkManager.php, line 274
Class
- MenuLinkManager
- Manages discovery, instantiation, and tree building of menu link plugins.
Namespace
Drupal\Core\Menu
Code
protected function deleteInstance(MenuLinkInterface $instance, $persist) { $id = $instance->getPluginId(); if ($instance->isDeletable()) { if ($persist) { $instance->deleteLink(); } } else { throw new PluginException("Menu link plugin with ID '$id' does not support deletion"); } $this->treeStorage->delete($id); }
Please login to continue.