class BricksServiceProvider in Bricks 8
Same name and namespace in other branches
- 2.x src/BricksServiceProvider.php \Drupal\bricks\BricksServiceProvider
Service Provider for Bricks.
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\bricks\BricksServiceProvider
Expanded class hierarchy of BricksServiceProvider
File
- src/
BricksServiceProvider.php, line 13
Namespace
Drupal\bricksView source
class BricksServiceProvider extends ServiceProviderBase {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
$modules = $container
->getParameter('container.modules');
// Check for installed Replicate module.
if (isset($modules['replicate'])) {
// Add a Replicate field event subscriber.
$service_definition = new Definition('Drupal\\bricks\\EventSubscriber\\ReplicateFieldSubscriber', [
new Reference('replicate.replicator'),
]);
$service_definition
->addTag('event_subscriber');
$service_definition
->setPublic(TRUE);
$container
->setDefinition('replicate.event_subscriber.bricks', $service_definition);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BricksServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceProviderBase:: |
|
ServiceProviderBase:: |
public | function |
Registers services to the container. Overrides ServiceProviderInterface:: |
1 |