Use a single associative entity related to different entities #6670

Closed
opened 2026-01-22 15:36:46 +01:00 by admin · 1 comment
Owner

Originally created by @ZaneCEO on GitHub (Apr 1, 2021).

This issue relates to my question "Doctrine in Symfony: use a single “Author” associative entity related to different entities" on StackOverflow.

In a nutshell: at the moment it looks like it's not possible to handle a single associative entity relating to two or more unrelated entities (depending on a third field).

I think it's unlikely that this cannot be done with Doctrine at the moment (it's a very common database design). What is more likely to me is that the feature isn't documented (or, at least, I cannot find it).

Originally created by @ZaneCEO on GitHub (Apr 1, 2021). This issue relates to my question "[Doctrine in Symfony: use a single “Author” associative entity related to different entities](https://stackoverflow.com/q/66901745/1204976)" on StackOverflow. In a nutshell: at the moment it looks like it's not possible to handle a single associative entity relating to two or more unrelated entities (depending on a third field). I think it's unlikely that this cannot be done with Doctrine at the moment (it's a very common database design). What is more likely to me is that the feature isn't documented (or, at least, I cannot find it).
admin closed this issue 2026-01-22 15:36:46 +01:00
Author
Owner

@ZaneCEO commented on GitHub (Apr 1, 2021):

Single table inheritance is what I was looking for.

@ZaneCEO commented on GitHub (Apr 1, 2021): [Single table inheritance](https://www.doctrine-project.org/projects/doctrine-orm/en/2.8/reference/inheritance-mapping.html#single-table-inheritance) is what I was looking for.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6670