mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Discriminator Mapping for Embeddables #6419
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 @Timmypedia on GitHub (Mar 4, 2020).
Feature Request
Summary
Some times (if you work with a Layered Architecture) you came to this weird situation :
Code
oAuth is our Entity right now, and ApiVersion should be the Embeddable, but it depends on the API i would like to call with that.
You have multiple implementations for a Value object in a Super Class. It would be nice, if I could describe a discriminator mapping for a Value object that is actually an Interface.
Is there a Workaround for such cases right now?
@beberlei commented on GitHub (Mar 15, 2020):
Yes, you can store the object using the DBAL
objecttype, which serializes it into the database as a BLOB. If you want it a bit nicer, you can store it as JSON and have a second column with the type and "hydrate" the objects yourself in getters.