[PR #10398] Move runtime check for to-many associations in mapped superclasses to a more suitable place #12329

Closed
opened 2026-01-22 16:13:43 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/10398

State: closed
Merged: No


Closing this since #10473 was merged; it removed the check altogether.


This PR moves the check that a mapped superclass does not declare to-many associations to a more suitable (IMHO) place.

It is no longer checked when another class inherits the association from the mapped superclass, but at the final runtime validation stage when loading the metadata for the mapped superclass itself.

In addition to that, can we review whether the check is correct for the case where we have

  • a base entity class with a to-many (non-owning) association
  • a mapped superclass below it
  • possibly another entity class below that

In other words, only the mapped superclass may not define to-many associations, but it is fine if an entity class above it does and when an entity class below inherits all that? My feeling is that should be fine.

**Original Pull Request:** https://github.com/doctrine/orm/pull/10398 **State:** closed **Merged:** No --- **Closing this** since #10473 was merged; it removed the check altogether. <hr> This PR moves the check that a mapped superclass does not declare to-many associations to a more suitable (IMHO) place. It is no longer checked when another class inherits the association from the mapped superclass, but at the final runtime validation stage when loading the metadata for the mapped superclass itself. In addition to that, can we review whether the check is correct for the case where we have * a base entity class with a to-many (non-owning) association * a mapped superclass below it * possibly another entity class below that In other words, only the mapped superclass may not define to-many associations, but it is fine if an entity class above it does and when an entity class below inherits all that? My feeling is that should be fine.
admin added the pull-request label 2026-01-22 16:13:43 +01:00
admin closed this issue 2026-01-22 16:13:43 +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#12329