vendor/sulu/sulu/src/Sulu/Bundle/RouteBundle/SuluRouteBundle.php line 26

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\RouteBundle;
  11. use Sulu\Bundle\PersistenceBundle\PersistenceBundleTrait;
  12. use Sulu\Bundle\RouteBundle\DependencyInjection\RouteGeneratorCompilerPass;
  13. use Sulu\Bundle\RouteBundle\Model\RouteInterface;
  14. use Sulu\Component\Route\RouteDefaultOptionsCompilerPass;
  15. use Sulu\Component\Symfony\CompilerPass\TaggedServiceCollectorCompilerPass;
  16. use Symfony\Component\DependencyInjection\Compiler\PassConfig;
  17. use Symfony\Component\DependencyInjection\ContainerBuilder;
  18. use Symfony\Component\HttpKernel\Bundle\Bundle;
  19. /**
  20.  * Entry point of sulu-route-bundle.
  21.  */
  22. class SuluRouteBundle extends Bundle
  23. {
  24.     use PersistenceBundleTrait;
  25.     public function build(ContainerBuilder $container)
  26.     {
  27.         parent::build($container);
  28.         $container->addCompilerPass(new RouteGeneratorCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -1024);
  29.         $container->addCompilerPass(
  30.             new RouteDefaultOptionsCompilerPass('sulu_route.routing.provider'5)
  31.         );
  32.         $container->addCompilerPass(
  33.             new TaggedServiceCollectorCompilerPass('sulu_route.routing.defaults_provider''sulu_route.defaults_provider')
  34.         );
  35.         $this->buildPersistence(
  36.             [
  37.                 RouteInterface::class => 'sulu.model.route.class',
  38.             ],
  39.             $container
  40.         );
  41.     }
  42. }