You are here

protected function DeclaredEmailManager::getDiscovery in Easy Email 8

Same name and namespace in other branches
  1. 2.0.x modules/easy_email_override/src/Service/DeclaredEmailManager.php \Drupal\easy_email_override\Service\DeclaredEmailManager::getDiscovery()

Gets the plugin discovery.

Return value

\Drupal\Component\Plugin\Discovery\DiscoveryInterface

Overrides DefaultPluginManager::getDiscovery

File

modules/easy_email_override/src/Service/DeclaredEmailManager.php, line 52

Class

DeclaredEmailManager
Manages discovery and instantiation of email plugins.

Namespace

Drupal\easy_email_override\Service

Code

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