vendor/sulu/redirect-bundle/SuluRedirectBundle.php line 24

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\RedirectBundle;
  11. use Sulu\Bundle\PersistenceBundle\PersistenceBundleTrait;
  12. use Sulu\Bundle\RedirectBundle\Entity\RedirectRoute;
  13. use Sulu\Component\Route\RouteDefaultOptionsCompilerPass;
  14. use Sulu\Component\Symfony\CompilerPass\TaggedServiceCollectorCompilerPass;
  15. use Symfony\Component\DependencyInjection\ContainerBuilder;
  16. use Symfony\Component\HttpKernel\Bundle\Bundle;
  17. /**
  18. * Entry-point for redirect-bundle.
  19. */
  20. class SuluRedirectBundle extends Bundle
  21. {
  22. use PersistenceBundleTrait;
  23. public function build(ContainerBuilder $container): void
  24. {
  25. $container->addCompilerPass(
  26. new TaggedServiceCollectorCompilerPass(
  27. 'sulu_redirect.import.aggregate_reader',
  28. 'sulu_redirect.import.reader'
  29. )
  30. );
  31. $container->addCompilerPass(
  32. new TaggedServiceCollectorCompilerPass(
  33. 'sulu_redirect.import.aggregate_converter',
  34. 'sulu_redirect.import.converter'
  35. )
  36. );
  37. $container->addCompilerPass(
  38. new RouteDefaultOptionsCompilerPass('sulu_redirect.routing.provider', 1)
  39. );
  40. $this->buildPersistence(
  41. [
  42. RedirectRoute::class => 'sulu.model.redirect_route.class',
  43. ],
  44. $container
  45. );
  46. }
  47. }