protected MenuLinkManager::deleteInstance(MenuLinkInterface $instance, $persist)
Deletes a specific instance.
\Drupal\Core\Menu\MenuLinkInterface $instance: The plugin instance to be deleted.
bool $persist: If TRUE, calls MenuLinkInterface::deleteLink() on the instance.
\Drupal\Component\Plugin\Exception\PluginException If the plugin instance does not support deletion.
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); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Menu!MenuLinkManager.php/function/MenuLinkManager::deleteInstance/8.1.x