class DomainSourceServiceProvider in Domain Access 8
Provides services for the domain module that extend core functionality.
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\domain_source\DomainSourceServiceProvider
Expanded class hierarchy of DomainSourceServiceProvider
File
- domain_source/
src/ DomainSourceServiceProvider.php, line 11
Namespace
Drupal\domain_sourceView source
class DomainSourceServiceProvider extends ServiceProviderBase {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
$definition = $container
->getDefinition('redirect_response_subscriber');
if ($this
->getDrupalVersion() > 8) {
$definition
->setClass('Drupal\\domain_source\\EventSubscriber\\DomainSourceRedirectResponseSubscriber');
}
else {
$definition
->setClass('Drupal\\domain_source\\EventSubscriber\\DomainSourceRedirectResponseSubscriberD8');
}
}
/**
* Determines the Drupal version.
*
* @return integer
* The core numberic version.
*/
private function getDrupalVersion() {
return (int) substr(\Drupal::VERSION, 0, 1);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DomainSourceServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceProviderBase:: |
|
DomainSourceServiceProvider:: |
private | function | Determines the Drupal version. | |
ServiceProviderBase:: |
public | function |
Registers services to the container. Overrides ServiceProviderInterface:: |
1 |