function MenuLinkManager::getDiscovery

Same name in other branches
  1. 9 core/lib/Drupal/Core/Menu/MenuLinkManager.php \Drupal\Core\Menu\MenuLinkManager::getDiscovery()
  2. 8.9.x core/lib/Drupal/Core/Menu/MenuLinkManager.php \Drupal\Core\Menu\MenuLinkManager::getDiscovery()
  3. 11.x core/lib/Drupal/Core/Menu/MenuLinkManager.php \Drupal\Core\Menu\MenuLinkManager::getDiscovery()

Gets the plugin discovery.

Return value

\Drupal\Component\Plugin\Discovery\DiscoveryInterface

File

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

Class

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

Namespace

Drupal\Core\Menu

Code

protected function getDiscovery() {
    if (!isset($this->discovery)) {
        $yaml_discovery = new YamlDiscovery('links.menu', $this->moduleHandler
            ->getModuleDirectories());
        $yaml_discovery->addTranslatableProperty('title', 'title_context');
        $yaml_discovery->addTranslatableProperty('description', 'description_context');
        $this->discovery = new ContainerDerivativeDiscoveryDecorator($yaml_discovery);
    }
    return $this->discovery;
}

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