vendor/zenstruck/redirect-bundle/src/ZenstruckRedirectBundle.php line 12

Open in your IDE?
  1. <?php
  2. namespace Zenstruck\RedirectBundle;
  3. use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass;
  4. use Symfony\Component\DependencyInjection\ContainerBuilder;
  5. use Symfony\Component\HttpKernel\Bundle\Bundle;
  6. /**
  7.  * @author Kevin Bond <kevinbond@gmail.com>
  8.  */
  9. class ZenstruckRedirectBundle extends Bundle
  10. {
  11.     public function build(ContainerBuilder $container)
  12.     {
  13.         parent::build($container);
  14.         $this->addRegisterMappingsPass($container);
  15.     }
  16.     private function addRegisterMappingsPass(ContainerBuilder $container)
  17.     {
  18.         $mappings = [
  19.             \realpath(__DIR__.'/Resources/config/doctrine-mapping') => 'Zenstruck\RedirectBundle\Model',
  20.         ];
  21.         $container->addCompilerPass(DoctrineOrmMappingsPass::createXmlMappingDriver($mappings));
  22.     }
  23. }