Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up[DoctrineBridge] indexBy could reference to association columns #38628
Conversation
| $associationMapping = $subMetadata->getAssociationMapping($fieldName); | ||
|
|
||
| /** @var ClassMetadataInfo $subMetadata */ | ||
| $indexProperty = $subMetadata->getSingleAssociationReferencedJoinColumnName($fieldName); |
xabbuh
Oct 27, 2020
Member
Shouldn't we add some kind of check that the column name used here is in fact the join column?
Shouldn't we add some kind of check that the column name used here is in fact the join column?
|
Please check #38861 also. |
|
I will take a look |
|
People at Doctrine says it could/shoud be a property (doctrine/orm#8018 (comment)) Given this is not clear, I suggest to supports both cases:
|
This is also reflected in description for ClassMetadataInfo which we use here (depending on how you understand the whole paragraph) describing "indexBy" as:
So it should be one of the fields on the entity, not a column. |
|
How does Doctrine behave for one or the other? Does it ignore the attribute? Does it try to map the column to a property or vice versa? |
6b58fa4
to
a0b6778
|
PR updated fixing #38861 (I hope) and adding tests |
|
LGTM |
cbd7c6f
to
f9a0e00
|
Thank you @juanmiguelbesada. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

This is my approach to solve #37982. It partials reverts @xabbuh PR #38604
This is my first Symfony contribution, so please, tell me if I need to do something more or something is wrong.
Also, this bug affects 4.x and 5.x versions. I think merging in this branches is done automatically. If not, please tell me.
Thanks you