vendor/sulu/sulu/src/Sulu/Bundle/PreviewBundle/SuluPreviewBundle.php line 27

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of Sulu.
  4. *
  5. * (c) Sulu GmbH
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace Sulu\Bundle\PreviewBundle;
  11. use Sulu\Bundle\PersistenceBundle\PersistenceBundleTrait;
  12. use Sulu\Bundle\PreviewBundle\Domain\Model\PreviewLinkInterface;
  13. use Sulu\Bundle\PreviewBundle\Infrastructure\Symfony\DependencyInjection\SuluPreviewExtension;
  14. use Sulu\Component\Symfony\CompilerPass\TaggedServiceCollectorCompilerPass;
  15. use Symfony\Component\DependencyInjection\ContainerBuilder;
  16. use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
  17. use Symfony\Component\HttpKernel\Bundle\Bundle;
  18. /**
  19. * Integrates preview into symfony.
  20. *
  21. * @final
  22. */
  23. class SuluPreviewBundle extends Bundle
  24. {
  25. use PersistenceBundleTrait;
  26. /**
  27. * @internal
  28. */
  29. public function build(ContainerBuilder $container): void
  30. {
  31. parent::build($container);
  32. $this->buildPersistence(
  33. [
  34. PreviewLinkInterface::class => 'sulu.model.preview_link.class',
  35. ],
  36. $container
  37. );
  38. $container->addCompilerPass(
  39. new TaggedServiceCollectorCompilerPass(
  40. 'sulu_preview.preview_object_provider_registry',
  41. 'sulu_preview.object_provider',
  42. 0,
  43. 'provider-key'
  44. )
  45. );
  46. }
  47. public function getContainerExtension(): ExtensionInterface
  48. {
  49. return new SuluPreviewExtension();
  50. }
  51. }