Drop automatic discriminator map discovery in 3.0? #6012

Closed
opened 2026-01-22 15:24:45 +01:00 by admin · 0 comments
Owner

Originally created by @Majkl578 on GitHub (Jul 3, 2018).

Originally assigned to: @Majkl578 on GitHub.

Proposal

Q A
RFC yes
BC Break yes

Summary

Metadata factory is currently performing an auto-discovery of discriminator members. This is often problematic and leads to multiple serious issues in long-run:

  1. since discovered entries are not namespaced, there is high probability of collision i.e. #7271),
  2. since class name is part of the discriminator map, the class must never be renamed.

We should deprecate and remove this behavior and replace it by @DiscriminatorValue: #6612

Originally created by @Majkl578 on GitHub (Jul 3, 2018). Originally assigned to: @Majkl578 on GitHub. ### Proposal | Q | A |------------ | ------ | RFC | yes | BC Break | yes #### Summary Metadata factory is currently performing an auto-discovery of discriminator members. This is often problematic and leads to multiple serious issues in long-run: 1) since discovered entries are not namespaced, there is high probability of collision i.e. #7271), 2) since class name is part of the discriminator map, the class must never be renamed. We should deprecate and remove this behavior and replace it by `@DiscriminatorValue`: #6612
admin added the BC Break label 2026-01-22 15:24:45 +01:00
admin closed this issue 2026-01-22 15:24:45 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6012