You are here

public function MessageNotifierBase::__construct in Message Notify 8

Constructs the plugin.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Logger\LoggerChannelInterface $logger: The message_notify logger channel.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager service.

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

\Drupal\message\MessageInterface $message: (optional) The message entity. This is required when sending or delivering a notification. If not passed to the constructor, use ::setMessage().

Overrides PluginBase::__construct

1 call to MessageNotifierBase::__construct()
Email::__construct in src/Plugin/Notifier/Email.php
Constructs the email notifier plugin.
1 method overrides MessageNotifierBase::__construct()
Email::__construct in src/Plugin/Notifier/Email.php
Constructs the email notifier plugin.

File

src/Plugin/Notifier/MessageNotifierBase.php, line 66

Class

MessageNotifierBase
An abstract implementation of MessageNotifierInterface.

Namespace

Drupal\message_notify\Plugin\Notifier

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, LoggerChannelInterface $logger, EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, MessageInterface $message = NULL) {

  // Set some defaults.
  $configuration += [
    'save on success' => TRUE,
    'save on fail' => FALSE,
  ];
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->logger = $logger;
  $this->entityTypeManager = $entity_type_manager;
  $this->message = $message;
  $this->renderer = $renderer;
}