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

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\ManagerPass;
  12. use ONGR\ElasticsearchBundle\DependencyInjection\Compiler\MappingPass;
  13. use ONGR\ElasticsearchBundle\DependencyInjection\Compiler\RepositoryPass;
  14. use Symfony\Component\DependencyInjection\Compiler\PassConfig;
  15. use Symfony\Component\DependencyInjection\ContainerBuilder;
  16. use Symfony\Component\HttpKernel\Bundle\Bundle;
  17. /**
  18.  * ONGR Elasticsearch bundle system file required by kernel.
  19.  */
  20. class ONGRElasticsearchBundle extends Bundle
  21. {
  22.     /**
  23.      * {@inheritdoc}
  24.      */
  25.     public function build(ContainerBuilder $container)
  26.     {
  27.         parent::build($container);
  28.         $container->addCompilerPass(new MappingPass());
  29.         $container->addCompilerPass(new ManagerPass());
  30.         // The `RepositoryPass` need to be behind the Symfony `DecoratorServicePass`
  31.         // to allow decorating the annotation reader
  32.         $container->addCompilerPass(new RepositoryPass(), PassConfig::TYPE_OPTIMIZE, -10);
  33.     }
  34. }