class TomeSyncServiceProvider in Tome 8
Registers services in the container.
@internal
Hierarchy
- class \Drupal\tome_sync\TomeSyncServiceProvider implements ServiceProviderInterface
Expanded class hierarchy of TomeSyncServiceProvider
File
- modules/
tome_sync/ src/ TomeSyncServiceProvider.php, line 16
Namespace
Drupal\tome_syncView source
class TomeSyncServiceProvider implements ServiceProviderInterface {
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container) {
$modules = $container
->getParameter('container.modules');
if (isset($modules['language'])) {
$container
->register('tome_sync.language_config_event_subscriber', LanguageConfigEventSubscriber::class)
->addTag('event_subscriber')
->addArgument(new Reference('config.storage.sync'));
}
if (isset($modules['book'])) {
$container
->register('tome_sync.book_event_subscriber', BookEventSubscriber::class)
->addTag('event_subscriber')
->addArgument(new Reference('database'))
->addArgument(new Reference('entity_type.manager'))
->addArgument(new Reference('file_system'));
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TomeSyncServiceProvider:: |
public | function |
Registers services to the container. Overrides ServiceProviderInterface:: |