You are here

public function DigestManager::getNotifiers in Message Digest 8

Returns the Digest notifier plugins.

Return value

\Drupal\message_digest\Plugin\Notifier\DigestInterface[] An associative array of Digest notifier plugins, keyed by plugin ID.

Overrides DigestManagerInterface::getNotifiers

1 call to DigestManager::getNotifiers()
DigestManager::processDigests in src/DigestManager.php
Processes digests waiting to be aggregated.

File

src/DigestManager.php, line 178

Class

DigestManager
Digest manager service.

Namespace

Drupal\message_digest

Code

public function getNotifiers() {
  $notifiers = [];
  foreach ($this->notifierManager
    ->getDefinitions() as $plugin_id => $plugin_definition) {
    $notifier = $this->notifierManager
      ->createInstance($plugin_id, []);
    if (!$notifier instanceof DigestInterface) {

      // Only load the "Digest" notifiers and skip the rest.
      continue;
    }
    $notifiers[$notifier
      ->getPluginId()] = $notifier;
  }
  return $notifiers;
}