class CommerceLogServiceProvider in Commerce Core 8.2
Registers event subscribers for installed Commerce modules.
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\commerce_log\CommerceLogServiceProvider
Expanded class hierarchy of CommerceLogServiceProvider
File
- modules/
log/ src/ CommerceLogServiceProvider.php, line 12
Namespace
Drupal\commerce_logView source
class CommerceLogServiceProvider extends ServiceProviderBase {
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container) {
// We cannot use the module handler as the container is not yet compiled.
// @see \Drupal\Core\DrupalKernel::compileContainer()
$modules = $container
->getParameter('container.modules');
if (isset($modules['commerce_cart'])) {
$container
->register('commerce_log.cart_subscriber', 'Drupal\\commerce_log\\EventSubscriber\\CartEventSubscriber')
->addTag('event_subscriber')
->addArgument(new Reference('entity_type.manager'));
}
if (isset($modules['commerce_checkout'])) {
$container
->register('commerce_log.checkout_subscriber', 'Drupal\\commerce_log\\EventSubscriber\\CheckoutEventSubscriber')
->addTag('event_subscriber')
->addArgument(new Reference('entity_type.manager'));
}
if (isset($modules['commerce_order'])) {
$container
->register('commerce_log.order_subscriber', 'Drupal\\commerce_log\\EventSubscriber\\OrderEventSubscriber')
->addTag('event_subscriber')
->addArgument(new Reference('entity_type.manager'));
$container
->register('commerce_log.order_mail_subscriber', 'Drupal\\commerce_log\\EventSubscriber\\OrderMailEventSubscriber')
->addTag('event_subscriber')
->addArgument(new Reference('entity_type.manager'))
->addArgument(new Reference('plugin.manager.commerce_log_template'));
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CommerceLogServiceProvider:: |
public | function |
Registers services to the container. Overrides ServiceProviderBase:: |
|
ServiceProviderBase:: |
public | function |
Modifies existing service definitions. Overrides ServiceModifierInterface:: |
5 |