You are here

public function IdentityChannelManager::getChannels in Courier 8

Same name and namespace in other branches
  1. 2.x src/Service/IdentityChannelManager.php \Drupal\courier\Service\IdentityChannelManager::getChannels()

Gets all channel implementations.

Return value

array Arrays of identity entity type IDs, keyed by channel entity type ID.

Overrides IdentityChannelManagerInterface::getChannels

1 call to IdentityChannelManager::getChannels()
IdentityChannelManager::getChannelsForIdentityType in src/Service/IdentityChannelManager.php
Get channels supported for an identity entity type.

File

src/Service/IdentityChannelManager.php, line 59

Class

IdentityChannelManager
Manages discovery and instantiation of CourierIdentity plugins.

Namespace

Drupal\courier\Service

Code

public function getChannels() {
  $channels = [];
  foreach ($this
    ->getNonFallbackDefinitions() as $plugin_id => $plugin) {
    $channel = $plugin['channel'];
    $identity_type = $plugin['identity'];
    if (!isset($channels[$channel]) || !in_array($identity_type, $channels[$channel])) {
      $channels[$channel][] = $identity_type;
    }
  }
  return $channels;
}