在Symfony2应用程序中,我有一个MainBundle和不同的包,可以启用或不启用.在MainBundle中,我需要拥有模型和基本实体.在OtherBundle的实体具有比相同的表名实体中MainBundle.
MainBundle中的夹具需要加载或不加载MainBundle以外的其他捆绑:
MainBundle
- Model 
- Entity (Table name "test")
- Fixtures 
OtherBundle
- Entity (Table name "test")
- Fixtures
OtherBundle2
- Entity (Table name="test")
- Fixtures
Run Code Online (Sandbox Code Playgroud)
如果我使用的@ORM\MappedSuperclass的模型,一个@ORM \实体的实体在MainBundle和@ORM \实体在OtherBundle然后Doctrine2停止与错误"表已经存在".
我不能使用继承表,因为我的模型不需要知道其他包中的其他实体.该@ORM\DiscriminatorMap着点OtherBundle.
有没有办法做到这一点 ?