You are here

class TomeSyncServiceProvider in Tome 8

Registers services in the container.

@internal

Hierarchy

Expanded class hierarchy of TomeSyncServiceProvider

File

modules/tome_sync/src/TomeSyncServiceProvider.php, line 16

Namespace

Drupal\tome_sync
View 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

Namesort descending Modifiers Type Description Overrides
TomeSyncServiceProvider::register public function Registers services to the container. Overrides ServiceProviderInterface::register