function StaticMenuLinkOverrides::loadOverride

Same name in other branches
  1. 8.9.x 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()
  3. 11.x core/lib/Drupal/Core/Menu/StaticMenuLinkOverrides.php \Drupal\Core\Menu\StaticMenuLinkOverrides::loadOverride()

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) {
    assert(is_string($id), 'Menu link plugin ID should be a string.');
    $all_overrides = $this->getConfig()
        ->get('definitions');
    $id = static::encodeId($id);
    return $all_overrides[$id] ?? [];
}

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