function LayoutPluginManager::getDiscovery

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

Overrides DefaultPluginManager::getDiscovery

File

core/lib/Drupal/Core/Layout/LayoutPluginManager.php, line 71

Class

LayoutPluginManager
Provides a plugin manager for layouts.

Namespace

Drupal\Core\Layout

Code

protected function getDiscovery() {
  if (!$this->discovery) {
    $discovery = new AttributeDiscoveryWithAnnotations($this->subdir, $this->namespaces, $this->pluginDefinitionAttributeName, $this->pluginDefinitionAnnotationName, $this->additionalAnnotationNamespaces);
    $discovery = new YamlDiscoveryDecorator($discovery, 'layouts', $this->moduleHandler
      ->getModuleDirectories() + $this->themeHandler
      ->getThemeDirectories());
    $discovery->addTranslatableProperty('label')
      ->addTranslatableProperty('description')
      ->addTranslatableProperty('category');
    $discovery = new AttributeBridgeDecorator($discovery, $this->pluginDefinitionAttributeName);
    $discovery = new ContainerDerivativeDiscoveryDecorator($discovery);
    $this->discovery = $discovery;
  }
  return $this->discovery;
}

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