RngConfiguration.php in RNG - Events and Registrations 3.x
File
src/RngConfiguration.php
View source
<?php
namespace Drupal\rng;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\courier\Service\IdentityChannelManagerInterface;
class RngConfiguration implements RngConfigurationInterface {
protected $configFactory;
protected $identityChannelManager;
public function __construct(ConfigFactoryInterface $config_factory, IdentityChannelManagerInterface $identity_channel_manager) {
$this->configFactory = $config_factory;
$this->identityChannelManager = $identity_channel_manager;
}
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);
}
}