You are here

public function IdentityChannelManager::getChannelsForIdentityType in Courier 8

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

Get channels supported for an identity entity type.

Parameters

string $identity_type_id: An identity entity type ID.

Return value

array An array of channel entity type IDs.

Overrides IdentityChannelManagerInterface::getChannelsForIdentityType

1 call to IdentityChannelManager::getChannelsForIdentityType()
IdentityChannelManager::getChannelsForIdentity in src/Service/IdentityChannelManager.php
@todo: Determine channel preference for individual identities. GH-2 | https://github.com/dpi/courier/issues/2

File

src/Service/IdentityChannelManager.php, line 87

Class

IdentityChannelManager
Manages discovery and instantiation of CourierIdentity plugins.

Namespace

Drupal\courier\Service

Code

public function getChannelsForIdentityType($identity_type_id) {
  $channels = [];
  foreach ($this
    ->getChannels() as $channel => $identity_types) {
    if (in_array($identity_type_id, $identity_types)) {
      $channels[] = $channel;
    }
  }
  return $channels;
}