In my Symfony2 project I have one bundle called MyBundle\BlogBundle. I'm using the command:
php app/console doctrine:mapping:import MyBundleBlogBundle xml
To generate mapping files in xml format. The default location in which the mapping files are generated is:
src/MyBundle/BlogBundle/Resources/config/doctrine
I would like to change that. It would be very nice if that directory could be:
src/MyBundle/BlogBundle/Mapping
Is this even possible to do? Above all I would like to change my Entity directory to:
src/MyBundle/BlogBundle/Model
This also does not seems to work with the doctrine:mapping:import command. For this to change I tried stuff like changing the config.yml to:
orm:
auto_generate_proxy_classes: "%kernel.debug%"
entity_managers:
MyBundle:
mappings:
MyBundleBlogBundle:
mapping: true
type: xml
dir: Model
alias: 'MyBundleBlogBundle'
prefix: 'MyBundle\BlogBundle\Model'
is_bundle: true
But this also does not seems to work. After this I did some research on Compiler Passes as used by e.g. the FosUserBundle. But I don't understand a lot of that yet.
Can I get the doctrine:mapping:import command to work with my desired directories? Or do I need to forget this command and create all the mappings and entities myself?
I would prefer to solve it with a Compiler Pass, but do not know how. Most important is the use of the Model directory instead of the Entity dir.