vendor/handcraftedinthealps/elasticsearch-bundle/ONGRElasticsearchBundle.php line 25

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the ONGR package.
  4.  *
  5.  * (c) NFQ Technologies UAB <info@nfq.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace ONGR\ElasticsearchBundle;
  11. use ONGR\ElasticsearchBundle\DependencyInjection\Compiler\AnnotationReaderPass;
  12. use ONGR\ElasticsearchBundle\DependencyInjection\Compiler\ManagerPass;
  13. use ONGR\ElasticsearchBundle\DependencyInjection\Compiler\MappingPass;
  14. use ONGR\ElasticsearchBundle\DependencyInjection\Compiler\RepositoryPass;
  15. use Symfony\Component\DependencyInjection\Compiler\PassConfig;
  16. use Symfony\Component\DependencyInjection\ContainerBuilder;
  17. use Symfony\Component\HttpKernel\Bundle\Bundle;
  18. /**
  19.  * ONGR Elasticsearch bundle system file required by kernel.
  20.  */
  21. class ONGRElasticsearchBundle extends Bundle
  22. {
  23.     /**
  24.      * {@inheritdoc}
  25.      */
  26.     public function build(ContainerBuilder $container)
  27.     {
  28.         parent::build($container);
  29.         $container->addCompilerPass(new MappingPass());
  30.         $container->addCompilerPass(new ManagerPass());
  31.         $container->addCompilerPass(new AnnotationReaderPass());
  32.         // The `RepositoryPass` need to be behind the Symfony `DecoratorServicePass`
  33.         // to allow decorating the annotation reader
  34.         $container->addCompilerPass(new RepositoryPass(), PassConfig::TYPE_OPTIMIZE, -10);
  35.     }
  36. }