class NodeServiceProvider
Same name in other branches
- 9 core/modules/node/src/NodeServiceProvider.php \Drupal\node\NodeServiceProvider
- 10 core/modules/node/src/NodeServiceProvider.php \Drupal\node\NodeServiceProvider
- 11.x core/modules/node/src/NodeServiceProvider.php \Drupal\node\NodeServiceProvider
Registers services in the container.
Hierarchy
- class \Drupal\node\NodeServiceProvider implements \Drupal\Core\DependencyInjection\ServiceProviderInterface
Expanded class hierarchy of NodeServiceProvider
File
-
core/
modules/ node/ src/ NodeServiceProvider.php, line 14
Namespace
Drupal\nodeView source
class NodeServiceProvider implements ServiceProviderInterface {
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container) {
// Register the node.node_translation_migrate service in the container if
// the migrate and language modules are enabled.
$modules = $container->getParameter('container.modules');
if (isset($modules['migrate']) && isset($modules['language'])) {
$container->register('node.node_translation_migrate', NodeTranslationMigrateSubscriber::class)
->addTag('event_subscriber')
->addArgument(new Reference('keyvalue'))
->addArgument(new Reference('state'));
}
// Register the node.node_translation_exception service in the container if
// the language module is enabled.
if (isset($modules['language'])) {
$container->register('node.node_translation_exception', NodeTranslationExceptionSubscriber::class)
->addTag('event_subscriber')
->addArgument(new Reference('keyvalue'))
->addArgument(new Reference('language_manager'))
->addArgument(new Reference('url_generator'))
->addArgument(new Reference('state'));
}
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
NodeServiceProvider::register | public | function | Registers services to the container. | Overrides ServiceProviderInterface::register |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.