0

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

h00ligan
  • 1,471
  • 9
  • 17
  • Did You check Your entity mappings in doctrine configuration? http://symfony.com/doc/current/doctrine/multiple_entity_managers.html – Rafal Kozlowski Aug 12 '16 at 14:05
  • Yes, I did check. I can't really post the whole thing here since it's a rather complex combination of php files reading the information from a yml file and building the mapping as a php array and as far as I can see it is correct. I will continue to dig through that array just in case (and will post an answer here if I find the problem there) – h00ligan Aug 12 '16 at 14:10

1 Answers1

0

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

user2268997
  • 1,263
  • 2
  • 14
  • 35
  • Tried that, still the exact same result, ran with --manager=A but entity manager A still attempts to do something with a class that belongs to entity manager B. – h00ligan Aug 14 '16 at 15:43
  • You should take care that all entities in your referenced bundle are managed by **manager A** – user2268997 Aug 15 '16 at 14:41
  • That was it, there were few entities managed by the wrong entity manager in there. Thx! – h00ligan Aug 15 '16 at 20:25