Symfony2 アプリケーションには、MainBundleと、有効または無効にできる個別のバンドルがあります。MainBundleには、Modelと基本的なEntityが必要です。OtherBundleでは、MainBundleのEntityと同じテーブル名を持つEntity。
MainBundle のフィクスチャは、 MainBundle 以外のバンドルの有無にかかわらずロードする必要があります。
MainBundle
- Model
- Entity (Table name "test")
- Fixtures
OtherBundle
- Entity (Table name "test")
- Fixtures
OtherBundle2
- Entity (Table name="test")
- Fixtures
Modelに @ORM\MappedSuperclass 、MainBundle の Entity に @ORM\Entity 、OtherBundle の@ORM \ Entityを使用した場合、Doctrine2は「テーブルが既に存在します」というエラーで停止します。
モデルが他のバンドル内の他のエンティティについて知る必要がないため、継承テーブルを使用できません。@ORM\DiscriminatorMapはOtherBundleを指すことができません。
これを行う方法はありますか?