I try to use Doctrine in Symfony 2.5 with an XML configuration for the entity mapping.
I have a namespaced class Bar
: ACME\TestBundle\Entity\Foo\Bar
As I have many entities they can't all reside in the ACME\TestBundle\Entity
namespace, but must be put into sub-namespaces.
Creating the entities is no problem, but I can't figure out where to put the ORM XML configuration files.
I tried Resources/config/doctrine/Foo/Bar.orm.xml
, which doesn't find the mapping file:
$ php app/console doctrine:schema:create --dump-sql
No Metadata Classes to process.
I tried Resources/config/doctrine/Bar.orm.xml
, which ignores the additional Foo
namespace unter Entity
, although the full namespace is correctly given in Bar.orm.xml
in the name
element.
$ php app/console doctrine:schema:create --dump-sql
[Doctrine\Common\Persistence\Mapping\MappingException]
Class 'ACME\TestBundle\Entity\Bar' does not exist
What am I missing? What is the correct place for the XML mapping file to reside for these namespaced classes?
Foo.Bar.orm.xml
. – Damian Polac