DoctrineMongoDBBundle.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.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 Symfony\Bundle\DoctrineMongoDBBundle;
  11. use Symfony\Component\DependencyInjection\Compiler\PassConfig;
  12. use Symfony\Component\DependencyInjection\ContainerBuilder;
  13. use Symfony\Component\HttpKernel\Bundle\Bundle;
  14. use Symfony\Bundle\DoctrineMongoDBBundle\DependencyInjection\Compiler\AddValidatorNamespaceAliasPass;
  15. use Symfony\Bundle\DoctrineMongoDBBundle\DependencyInjection\Compiler\CreateHydratorDirectoryPass;
  16. use Symfony\Bundle\DoctrineMongoDBBundle\DependencyInjection\Compiler\CreateProxyDirectoryPass;
  17. use Symfony\Bundle\DoctrineMongoDBBundle\DependencyInjection\Compiler\RegisterEventListenersAndSubscribersPass;
  18. /**
  19. * Doctrine MongoDB ODM bundle.
  20. *
  21. * @author Bulat Shakirzyanov <bulat@theopenskyproject.com>
  22. * @author Kris Wallsmith <kris.wallsmith@symfony.com>
  23. * @author Jonathan H. Wage <jonwage@gmail.com>
  24. */
  25. class DoctrineMongoDBBundle extends Bundle
  26. {
  27. public function build(ContainerBuilder $container)
  28. {
  29. parent::build($container);
  30. $container->addCompilerPass(new AddValidatorNamespaceAliasPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION);
  31. $container->addCompilerPass(new RegisterEventListenersAndSubscribersPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION);
  32. $container->addCompilerPass(new CreateProxyDirectoryPass(), PassConfig::TYPE_BEFORE_REMOVING);
  33. $container->addCompilerPass(new CreateHydratorDirectoryPass(), PassConfig::TYPE_BEFORE_REMOVING);
  34. }
  35. }