You are here

public function MenuLinkManager::resetLink in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Menu/MenuLinkManager.php \Drupal\Core\Menu\MenuLinkManager::resetLink()

Resets the values for a menu link based on the values found by discovery.

Parameters

string $id: The menu link plugin ID.

Return value

\Drupal\Core\Menu\MenuLinkInterface The menu link instance after being reset.

Throws

\Drupal\Component\Plugin\Exception\PluginException Thrown if the $id is not a valid, existing, plugin ID or if the link cannot be reset.

Overrides MenuLinkManagerInterface::resetLink

File

core/lib/Drupal/Core/Menu/MenuLinkManager.php, line 376

Class

MenuLinkManager
Manages discovery, instantiation, and tree building of menu link plugins.

Namespace

Drupal\Core\Menu

Code

public function resetLink($id) {
  $instance = $this
    ->createInstance($id);
  $new_instance = $this
    ->resetInstance($instance);
  return $new_instance;
}