No, this does not make sense, because later the ORM should map the results to objects. You cannot match both ValB and ValC with the same property in Main
To do this correctly, the Main table must have separate fields for the ValB and ValC . Even if they have the same meaning. Like this
βββββββββ ββββββββββ βββββββββ β ValB β β Main β β ValC β β βββ¦βββββ£ β βββ¦ββββββ£ β βββ¦βββββ£ β *β pk β-- + β *β pk β +---β *β pk β β βββ¬βββββ£ | β βββ¬ββββββ£ | β βββ¬βββββ£ β β β +--β βvB_idβ | β β β β βββ¬βββββ£ β βββ¬ββββββ£ | β βββ¬βββββ£ β β β β βvC_idβ---+ β β β ββββ©βββββ ββββ©ββββββ ββββ©βββββ
You can copy the v_id column and then do the correct mapping in Doctrine.
source share