Skip to content
Snippets Groups Projects
Select Git revision
  • 1d95dcbf28c90e9f6f0bf9618d913b8a9a70c7e4
  • 11.x default protected
  • 10.5.x protected
  • 10.6.x protected
  • 11.2.x protected
  • 11.1.x protected
  • 10.4.x protected
  • 11.0.x protected
  • 10.3.x protected
  • 7.x protected
  • 10.2.x protected
  • 10.1.x protected
  • 9.5.x protected
  • 10.0.x protected
  • 9.4.x protected
  • 9.3.x protected
  • 9.2.x protected
  • 9.1.x protected
  • 8.9.x protected
  • 9.0.x protected
  • 8.8.x protected
  • 10.5.1 protected
  • 11.2.2 protected
  • 11.2.1 protected
  • 11.2.0 protected
  • 10.5.0 protected
  • 11.2.0-rc2 protected
  • 10.5.0-rc1 protected
  • 11.2.0-rc1 protected
  • 10.4.8 protected
  • 11.1.8 protected
  • 10.5.0-beta1 protected
  • 11.2.0-beta1 protected
  • 11.2.0-alpha1 protected
  • 10.4.7 protected
  • 11.1.7 protected
  • 10.4.6 protected
  • 11.1.6 protected
  • 10.3.14 protected
  • 10.4.5 protected
  • 11.0.13 protected
41 results

common.inc

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ParagraphsServiceProvider.php 1.43 KiB
    <?php
    
    namespace Drupal\paragraphs;
    
    use Drupal\Core\DependencyInjection\ContainerBuilder;
    use Drupal\Core\DependencyInjection\ServiceProviderBase;
    use Symfony\Component\DependencyInjection\Definition;
    use Symfony\Component\DependencyInjection\Reference;
    
    /**
     * Service Provider for Paragraphs.
     */
    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);
        }
        // Check for installed Migrate module.
        if (isset($modules['migrate']) ) {
          // Add a Migration plugins alterer service.
          $service_definition = new Definition('Drupal\paragraphs\MigrationPluginsAlterer');
          $service_definition->addArgument(new Reference('logger.factory'));
          $service_definition->setPublic(TRUE);
          $container->setDefinition('paragraphs.migration_plugins_alterer', $service_definition);
        }
      }
    }