Search code examples
phpsymfonydoctrinealice-fixtures

AliceBundle with multiple entity managers?


Anyone know if AliceBundle (https://github.com/hautelook/AliceBundle) supports multiple entity managers or my em mapping is somehow screwed up. I have a bundle (BundleA) that has seven entity objects but have only configured one class, EntityA, to generate entities for but when I try loading the fixtures it fails with this error:

  [Doctrine\Common\Persistence\Mapping\MappingException]
  The class 'BundleB\Entity\ClassB' was not found in the chain configured namespaces <list of namespaces not including the 'BundleB\Entity' namespace>

BundleA and BundleB are on two different entity managers and there's no direct link between them. BundleA is within the default manager while BundleB is in one of the other entity managers. Both bundles have multiple entity classes that are working fine in a live environment.

I've been checking if the entity manager mapping is set up wrong but haven't been able to see anything strange going on there so my next thing to check was to figure out if AliceBundle doesn't support multiple EMs but I can't find any documentation saying one way or the other.

All entities are Doctrine ORM entities


Solution

  • You must tell the bundle what Entity Manager to use manually by providing the --manager option.