You are here

class DepcalcServiceProvider in Dependency Calculation 8

Optionally adds to the container when content_moderation is enabled.

Hierarchy

Expanded class hierarchy of DepcalcServiceProvider

File

src/DepcalcServiceProvider.php, line 12

Namespace

Drupal\depcalc
View source
class DepcalcServiceProvider extends ServiceProviderBase {

  /**
   * {@inheritdoc}
   */
  public function alter(ContainerBuilder $container) {
    parent::alter($container);
    if ($container
      ->hasDefinition('content_moderation.moderation_information')) {
      $container
        ->getDefinition('workflow.dependency_calculator')
        ->addArgument(new Reference('content_moderation.moderation_information'));
    }
    if ($container
      ->hasDefinition('plugin.manager.core.layout')) {
      $container
        ->getDefinition('layout_builder.dependency_calculator')
        ->addArgument(new Reference('plugin.manager.core.layout'));
      $container
        ->getDefinition('layout_builder.entity_view_display.dependency_calculator')
        ->addArgument(new Reference('plugin.manager.core.layout'));
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DepcalcServiceProvider::alter public function Modifies existing service definitions. Overrides ServiceProviderBase::alter
ServiceProviderBase::register public function Registers services to the container. Overrides ServiceProviderInterface::register 1