mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Embedded + DiscriminatorMap #5781
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 @SerafimArts on GitHub (Nov 22, 2017).
Originally assigned to: @lcobucci on GitHub.
It does not turn out to befriending Embedded and DiscriminatorMap and I did not find it in the documentation.
An example of a code (The code is simplified):
Table:
Main Entity:
Embedded:
In my cozy inner world, the following should happen like this (example):
But... Errors emerge, such as:
or:
...and the like.
I tried all the combinations of Embedded, InheritanceType, Entity, MappedSuperclass, etc =\
@lcobucci commented on GitHub (Nov 24, 2017):
@SerafimArts embeddables are not entities but value objects, which means that we don't support that. In order to achieve the result you want you should use a 1-to-1 or many-to-1 association (or not use inheritance at all).
Embedded objects are going to suffer a major redesign on
v3.0but for that these are the options we have.@lcobucci commented on GitHub (Nov 24, 2017):
I'll close the issue, please reopen if you have further questions 👍