You are here

public function DigestBase::__construct in Message Digest 8

Constructs the digest notifier plugins.

Parameters

array $configuration: Plugin configuration array.

string $plugin_id: The plugin ID.

mixed $plugin_definition: The plugin definition.

\Drupal\Core\Logger\LoggerChannelInterface $logger: The message notify logger channel.

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

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

\Drupal\message\MessageInterface $message: (optional) The message entity.

\Drupal\Core\State\StateInterface $state: The state service.

\Drupal\Core\Database\Connection $connection: The database connection.

\Drupal\Component\Datetime\TimeInterface $time: The time service.

Overrides MessageNotifierBase::__construct

File

src/Plugin/Notifier/DigestBase.php, line 76

Class

DigestBase
Message Digest notifier.

Namespace

Drupal\message_digest\Plugin\Notifier

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, LoggerChannelInterface $logger, EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, MessageInterface $message = NULL, StateInterface $state, Connection $connection, TimeInterface $time) {

  // Set some defaults.
  $configuration += [
    'entity_type' => '',
    'entity_id' => '',
  ];
  parent::__construct($configuration, $plugin_id, $plugin_definition, $logger, $entity_type_manager, $renderer, $message);
  $this->connection = $connection;
  $this->digestInterval = $plugin_definition['digest_interval'];
  $this->time = $time;
  $this->state = $state;
}