You are here

protected function MenuLinkManager::processDefinition in Zircon Profile 8.0

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

Performs extra processing on plugin definitions.

By default we add defaults for the type to the definition. If a type has additional processing logic, the logic can be added by replacing or extending this method.

Parameters

array $definition: The definition to be processed and modified by reference.

$plugin_id: The ID of the plugin this definition is being used for.

2 calls to MenuLinkManager::processDefinition()
MenuLinkManager::addDefinition in core/lib/Drupal/Core/Menu/MenuLinkManager.php
Adds a new menu link definition to the menu tree storage.
MenuLinkManager::getDefinitions in core/lib/Drupal/Core/Menu/MenuLinkManager.php
Gets the definition of all plugins for this type.

File

core/lib/Drupal/Core/Menu/MenuLinkManager.php, line 131
Contains \Drupal\Core\Menu\MenuLinkManager.

Class

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

Namespace

Drupal\Core\Menu

Code

protected function processDefinition(array &$definition, $plugin_id) {
  $definition = NestedArray::mergeDeep($this->defaults, $definition);

  // Typecast so NULL, no parent, will be an empty string since the parent ID
  // should be a string.
  $definition['parent'] = (string) $definition['parent'];
  $definition['id'] = $plugin_id;
}