In a Symfony2 application I have a MainBundle and distinct bundles which can be enabled or not. In the MainBundle I need to have the Model and a basic Entity. In an OtherBundle an Entity with the same table name than Entity in MainBundle.
Fixtures in MainBundle need to be loaded with or without the other bundles than MainBundle :
MainBundle
- Model
- Entity (Table name "test")
- Fixtures
OtherBundle
- Entity (Table name "test")
- Fixtures
OtherBundle2
- Entity (Table name="test")
- Fixtures
If i used the @ORM\MappedSuperclass for the Model, a @ORM\Entity for the Entity in MainBundle and @ORM\Entity in OtherBundle then Doctrine2 stop with the error "table already exists".
I cant use the Inheritance table as my model dont need to know about other entities in the other bundles. The @ORM\DiscriminatorMap cant point to OtherBundle.
Is there a way to do this ?