mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Combine Single-Table-Inheritance and Embeddables (=Single-Field-Inheritance?) #5845
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 @MarkusRodler on GitHub (Jan 14, 2018).
Originally assigned to: @Ocramius on GitHub.
Hello,
I want to use some sort of Single-Table-Inheritance (or maybe better: Single-Field-Inheritance).
PHP Example:
I have an abstract class AbstractDifficulty.
This AbstractDifficulty has three concrete classes (HardDifficulty, MediumDifficulty and EasyDifficulty)
And I have a class called Job. Every Job has a title and one difficulty.
My database schema should therefore look like this:
In my php classes I thought it would be enough to have this:
But that is not working. Doctrine does not generate a field "difficulty" in the job table. Maybe the two features (Embeddables and SingleTable-Inheritance) are not combinable. But if they are combinable then it would be great if someone can give me a hint.
Thanks!