mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
indexBy Not Supported by AssociationOverride in Doctrine #7481
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ehibes on GitHub (Mar 1, 2025).
Problem Description
Currently, the indexBy attribute in Doctrine's OneToMany association is not supported by AssociationOverride. This limitation prevents developers from overriding the indexBy configuration in subclasses when extending a mapped superclass.
Detailed Example
Consider the following XML mapping in a mapped superclass:
In this example, the channelPricings collection is indexed by channelCode.
However, when extending this mapped superclass, there is no straightforward way to override the indexBy attribute using AssociationOverride.
@ehibes commented on GitHub (Mar 1, 2025):
To get around the problem, I completely redefined the relationship by specifying a different indexBy.