Created
October 17, 2015 20:46
-
-
Save nexik/3bfe4b11bf4ba93bfce8 to your computer and use it in GitHub Desktop.
doctrine custom mapping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace AppBundle; | |
| use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass; | |
| use Symfony\Component\DependencyInjection\ContainerBuilder; | |
| use Symfony\Component\HttpKernel\Bundle\Bundle; | |
| class AppBundle extends Bundle | |
| { | |
| public function build(ContainerBuilder $builder) | |
| { | |
| $builder->addCompilerPass($this->buildMappingCompilerPass()); | |
| } | |
| private function buildMappingCompilerPass() | |
| { | |
| return DoctrineOrmMappingsPass::createYamlMappingDriver( | |
| [ | |
| __DIR__ . '/Resources/doctrine/common' => 'App\Common', | |
| __DIR__ . '/Resources/doctrine/security' => 'App\Security', | |
| ] | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment