You are here

public function MailManager::__construct in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Mail/MailManager.php \Drupal\Core\Mail\MailManager::__construct()

Constructs the MailManager object.

Parameters

\Traversable $namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations.

\Drupal\Core\Cache\CacheBackendInterface $cache_backend: Cache backend instance to use.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler to invoke the alter hook with.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The configuration factory.

\Drupal\Core\Logger\LoggerChannelFactoryInterface $logger_factory: The logger channel factory.

\Drupal\Core\StringTranslation\TranslationInterface $string_translation: The string translation service.

\Drupal\Core\Render\RendererInterface $renderer: The renderer.

Overrides DefaultPluginManager::__construct

File

core/lib/Drupal/Core/Mail/MailManager.php, line 80

Class

MailManager
Provides a Mail plugin manager.

Namespace

Drupal\Core\Mail

Code

public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory, LoggerChannelFactoryInterface $logger_factory, TranslationInterface $string_translation, RendererInterface $renderer) {
  parent::__construct('Plugin/Mail', $namespaces, $module_handler, 'Drupal\\Core\\Mail\\MailInterface', 'Drupal\\Core\\Annotation\\Mail');
  $this
    ->alterInfo('mail_backend_info');
  $this
    ->setCacheBackend($cache_backend, 'mail_backend_plugins');
  $this->configFactory = $config_factory;
  $this->loggerFactory = $logger_factory;
  $this->stringTranslation = $string_translation;
  $this->renderer = $renderer;
}