MenuLinkManager::resetLink

public MenuLinkManager::resetLink($id)

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 378

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;
}
doc_Drupal
2016-10-29 09:27:08
Comments
Leave a Comment

Please login to continue.