function CKEditor5PluginManager::getDiscovery

Same name in other branches
  1. 9 core/modules/ckeditor5/src/Plugin/CKEditor5PluginManager.php \Drupal\ckeditor5\Plugin\CKEditor5PluginManager::getDiscovery()
  2. 11.x core/modules/ckeditor5/src/Plugin/CKEditor5PluginManager.php \Drupal\ckeditor5\Plugin\CKEditor5PluginManager::getDiscovery()

Overrides DefaultPluginManager::getDiscovery

File

core/modules/ckeditor5/src/Plugin/CKEditor5PluginManager.php, line 65

Class

CKEditor5PluginManager
Provides a CKEditor 5 plugin manager.

Namespace

Drupal\ckeditor5\Plugin

Code

protected function getDiscovery() {
    if (!$this->discovery) {
        $discovery = new AttributeDiscoveryWithAnnotations($this->subdir, $this->namespaces, $this->pluginDefinitionAttributeName, $this->pluginDefinitionAnnotationName, $this->additionalAnnotationNamespaces);
        $discovery = new YamlDiscoveryDecorator($discovery, 'ckeditor5', $this->moduleHandler
            ->getModuleDirectories());
        // Note: adding translatable properties here is impossible because it only
        // supports top-level properties.
        // @see \Drupal\ckeditor5\Plugin\CKEditor5PluginDefinition::label()
        $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.