You are here

protected function TypeManager::getDiscovery in Charts 8.4

Same name and namespace in other branches
  1. 5.0.x src/TypeManager.php \Drupal\charts\TypeManager::getDiscovery()

Gets the plugin discovery.

Return value

\Drupal\Component\Plugin\Discovery\DiscoveryInterface

Overrides DefaultPluginManager::getDiscovery

File

src/TypeManager.php, line 67

Class

TypeManager
Manages discovery and instantiation of charts_type_info plugins.

Namespace

Drupal\charts

Code

protected function getDiscovery() {
  if (!isset($this->discovery)) {
    $this->discovery = new YamlDiscovery('charts_types', $this->moduleHandler
      ->getModuleDirectories());
    $this->discovery
      ->addTranslatableProperty('label', 'label_context');
    $this->discovery = new ContainerDerivativeDiscoveryDecorator($this->discovery);
  }
  return $this->discovery;
}