class ParagraphsServiceProvider in Paragraphs 8
Service Provider for Paragraphs.
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\paragraphs\ParagraphsServiceProvider
Expanded class hierarchy of ParagraphsServiceProvider
File
- src/
ParagraphsServiceProvider.php, line 13
Namespace
Drupal\paragraphsView source
class ParagraphsServiceProvider extends ServiceProviderBase {
/**
* {@inheritdoc}
*/
public function register(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\\paragraphs\\EventSubscriber\\ReplicateFieldSubscriber', [
new Reference('replicate.replicator'),
]);
$service_definition
->addTag('event_subscriber');
$service_definition
->setPublic(TRUE);
$container
->setDefinition('replicate.event_subscriber.paragraphs', $service_definition);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ParagraphsServiceProvider:: |
public | function |
Registers services to the container. Overrides ServiceProviderBase:: |
|
ServiceProviderBase:: |
public | function |
Modifies existing service definitions. Overrides ServiceModifierInterface:: |
5 |