私は最初にこの質問をここに投稿しました: https://github.com/doctrine/DoctrineBundle/issues/297
私は次のエンティティ階層を持っています. MyProductは、クラステーブルの継承によってマップされた親エンティティです:
SyliusProduct # Mapped superclass containing the 'options' association mapping
–- MyProduct # Mapped superclass that should override the association (Head of CTI)
---- MyProduct1 # Ultimate children (entities)
---- MyProduct2
---- MyProduct3
---- MyProduct4
SyliusProductには、 SyliusProductのマッピングでマッピングされるOptionエンティティへの多対多の関連付けがあります。
SyliusProductのマッピングを変更できません(Symfony ベンダーの一部です)。
スキーマを生成するとき、doctrine は最終的な子ごとにsylius_product_optionsテーブルを生成しようとしますが、これは 'tables exists' 例外をスローします。
次のいずれかの方法はありますか:
- 4 つの異なるテーブルを作成して (そして異なるテーブル名を指定して)、最終的な子レベルで関連付けをマップしますか?
- MyProductレベルでマップしますか?
- 単に関連付けを無視しますか?