function MenuTreeStorageInterface::save

Same name in other branches
  1. 9 core/lib/Drupal/Core/Menu/MenuTreeStorageInterface.php \Drupal\Core\Menu\MenuTreeStorageInterface::save()
  2. 8.9.x core/lib/Drupal/Core/Menu/MenuTreeStorageInterface.php \Drupal\Core\Menu\MenuTreeStorageInterface::save()
  3. 10 core/lib/Drupal/Core/Menu/MenuTreeStorageInterface.php \Drupal\Core\Menu\MenuTreeStorageInterface::save()

Saves a plugin definition to the storage.

Parameters

array $definition: A definition for a \Drupal\Core\Menu\MenuLinkInterface plugin.

Return value

array The menu names affected by the save operation. This will be one menu name if the link is saved to the sane menu, or two if it is saved to a new menu.

Throws

\Exception Thrown if the storage back-end does not exist and could not be created.

\Drupal\Component\Plugin\Exception\PluginException Thrown if the definition is invalid - for example, if the specified parent would cause the links children to be moved to greater than the maximum depth.

1 method overrides MenuTreeStorageInterface::save()
MenuTreeStorage::save in core/lib/Drupal/Core/Menu/MenuTreeStorage.php
Saves a plugin definition to the storage.

File

core/lib/Drupal/Core/Menu/MenuTreeStorageInterface.php, line 109

Class

MenuTreeStorageInterface
Defines an interface for storing a menu tree containing menu link IDs.

Namespace

Drupal\Core\Menu

Code

public function save(array $definition);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.