戻る
■カスタマイズ: テーブル間のリレーション
Symfonyの仕様で、Entityに対してアノテーションを設定して「OneToOne」「OneToMany」などを指定する 1対多リレーションについて|ジャムブログ
https://jum11.com/2020/10/26/ec-cube4-manytoone/
ステップ 8: データ構造の説明 (Symfony Docs)
https://symfony.com/doc/current/the-fast-track/ja/8-doctrine.html
既存テーブルに紐付けを追加する場合、 app\Customize\Entity\ProductTrait.php などEntityのtraitを作成してそこでアノテーションを設定するといいみたい(オリジナルのEntityを複製して編集、ではない) Entityのカスタマイズ - < for EC-CUBE 4.0 Developers />
https://doc4.ec-cube.net/customize_entity
ただしマスターデータのテーブルは、traitで拡張できない 仕様なのか、今後調整されるのかは不明 MasterテーブルがTraitで拡張できない - Issue #4325 - EC-CUBE/ec-cube
https://github.com/EC-CUBE/ec-cube/issues/4325