public function StaticMenuLinkOverrides::loadOverride

public StaticMenuLinkOverrides::loadOverride($id)

Loads any overrides to the definition of a static (YAML-defined) link.

Parameters

string $id: A menu link plugin ID.

Return value

array|NULL An override with following supported keys:

  • parent
  • weight
  • menu_name
  • expanded
  • enabled

or NULL if there is no override for the given ID.

Overrides StaticMenuLinkOverridesInterface::loadOverride

File

core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php, line 73

Class

StaticMenuLinkOverrides
Defines an implementation of the menu link override using a config file.

Namespace

Drupal\Core\Menu

Code

public function loadOverride($id) {
  $all_overrides = $this->getConfig()->get('definitions');
  $id = static::encodeId($id);
  return $id && isset($all_overrides[$id]) ? $all_overrides[$id] : array();
}

© 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!StaticMenuLinkOverrides.php/function/StaticMenuLinkOverrides::loadOverride/8.1.x