You are here

class RngConfiguration in RNG - Events and Registrations 8

Same name and namespace in other branches
  1. 8.2 src/RngConfiguration.php \Drupal\rng\RngConfiguration
  2. 3.x src/RngConfiguration.php \Drupal\rng\RngConfiguration

The RNG Configuration service.

Hierarchy

Expanded class hierarchy of RngConfiguration

1 string reference to 'RngConfiguration'
rng.services.yml in ./rng.services.yml
rng.services.yml
1 service uses RngConfiguration
rng.configuration in ./rng.services.yml
Drupal\rng\RngConfiguration

File

src/RngConfiguration.php, line 11

Namespace

Drupal\rng
View source
class RngConfiguration implements RngConfigurationInterface {

  /**
   * The config factory service.
   *
   * @var \Drupal\Core\Config\ConfigFactoryInterface
   */
  protected $configFactory;

  /**
   * The identity channel manager.
   *
   * @var \Drupal\courier\Service\IdentityChannelManagerInterface
   */
  protected $identityChannelManager;

  /**
   * Constructs a new RegistrantFactory object.
   *
   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
   *   The config factory service.
   * @param \Drupal\courier\Service\IdentityChannelManagerInterface $identity_channel_manager
   *   The identity channel manager.
   */
  public function __construct(ConfigFactoryInterface $config_factory, IdentityChannelManagerInterface $identity_channel_manager) {
    $this->configFactory = $config_factory;
    $this->identityChannelManager = $identity_channel_manager;
  }

  /**
   * {@inheritdoc}
   */
  public function getIdentityTypes() {
    $config = $this->configFactory
      ->get('rng.settings');
    $identity_types = $config
      ->get('identity_types');
    $allowed_identity_types = is_array($identity_types) ? $identity_types : [];
    $available_identity_types = $this->identityChannelManager
      ->getIdentityTypes();
    return array_intersect($allowed_identity_types, $available_identity_types);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RngConfiguration::$configFactory protected property The config factory service.
RngConfiguration::$identityChannelManager protected property The identity channel manager.
RngConfiguration::getIdentityTypes public function Get valid identity entity types. Overrides RngConfigurationInterface::getIdentityTypes
RngConfiguration::__construct public function Constructs a new RegistrantFactory object.