You are here

public function StaticMenuLinkOverrides::loadOverride in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php \Drupal\Core\Menu\StaticMenuLinkOverrides::loadOverride()
  2. 10 core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php \Drupal\Core\Menu\StaticMenuLinkOverrides::loadOverride()

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

1 call to StaticMenuLinkOverrides::loadOverride()
StaticMenuLinkOverrides::saveOverride in core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php
Saves the override.

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] : [];
}