I am trying to store entities in MyBundle/OtherNamespacePart/Entity directory.
If I run doctrine:schema:create
, i get this error message:
Class MyBundle/Entity/MyEntity does not exist and could not be loaded.
I don't get, why is "OtherNamespacePart" ignored (should be MyBundle/OtherNamespacePart/Entity/MyEntity). I checked whole project if there is everything namespaced and named correctly and it seems to me ok. If i store entities directly in entity directory, it works (just need to remove all "OtherNamespacePart").
Isn't problem in console command tool, that expects entities in entity directory? Is there any workaround or configuration option?
You can do this by providing custom mappings in your config.yml
e.g.:
doctrine:
orm:
auto_generate_proxy_classes: %kernel.debug%
auto_mapping: false
mappings:
name:
type: xml
dir: %kernel.root_dir%/../src/Your/Bundle/Resources/config/doctrine
alias: MyModels
prefix: MyBundle\OtherNamespacePart\Entity
is_bundle: false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With