class RngConfiguration in RNG - Events and Registrations 8
Same name and namespace in other branches
- 8.2 src/RngConfiguration.php \Drupal\rng\RngConfiguration
- 3.x src/RngConfiguration.php \Drupal\rng\RngConfiguration
The RNG Configuration service.
Hierarchy
- class \Drupal\rng\RngConfiguration implements RngConfigurationInterface
Expanded class hierarchy of RngConfiguration
1 string reference to 'RngConfiguration'
1 service uses RngConfiguration
File
- src/
RngConfiguration.php, line 11
Namespace
Drupal\rngView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RngConfiguration:: |
protected | property | The config factory service. | |
RngConfiguration:: |
protected | property | The identity channel manager. | |
RngConfiguration:: |
public | function |
Get valid identity entity types. Overrides RngConfigurationInterface:: |
|
RngConfiguration:: |
public | function | Constructs a new RegistrantFactory object. |