protected function MenuLinkManager::processDefinition

protected MenuLinkManager::processDefinition(array &$definition, $plugin_id)

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.

File

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

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;
}

© 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::processDefinition/8.1.x