class DomainRegistrationPattern in Restrict Domain Registration 8
Sets the _admin_route for specific group-related routes.
Hierarchy
- class \Drupal\domain_registration\DomainRegistrationPattern implements DomainRegistrationPatternInterface
Expanded class hierarchy of DomainRegistrationPattern
1 string reference to 'DomainRegistrationPattern'
1 service uses DomainRegistrationPattern
File
- src/
DomainRegistrationPattern.php, line 10
Namespace
Drupal\domain_registrationView source
class DomainRegistrationPattern implements DomainRegistrationPatternInterface {
/**
* The config factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* Constructs a new DomainRegistrationPattern object.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory.
*/
public function __construct(ConfigFactoryInterface $config_factory) {
$this->configFactory = $config_factory;
}
/**
* {@inheritdoc}
*/
public function getPatterns() {
if ($domains = $this->configFactory
->get('domain_registration.settings')
->get('pattern')) {
$domains = explode("\r\n", $domains);
}
return $domains ?: [];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DomainRegistrationPattern:: |
protected | property | The config factory. | |
DomainRegistrationPattern:: |
public | function |
Returns an array of domain patterns based on the configuration. Overrides DomainRegistrationPatternInterface:: |
|
DomainRegistrationPattern:: |
public | function | Constructs a new DomainRegistrationPattern object. |