Description
BC Break Report
Q | A |
---|---|
BC Break | yes |
Version | 2.9.x, 2.10.x |
Summary
As mentioned in #8771 (comment), there is a regression that affects both 2.9
and 2.10
:
If an entity hierarchy has an abstract entity class in the middle of the hierarchy, Doctrine complains that it must be part of the discriminator map. Example:
- abstract class
A
- abstract class
B
- class
C
- class
- abstract class
bin/console doctrine:schema:validate
reports:
[FAIL] The entity-class B mapping is invalid:
- Entity class 'B' is part of inheritance hierarchy, but is not mapped in the root entity 'A' discriminator map. All subclasses must be listed in the discriminator map.
This doesn't make sense, as there cannot be an entry in the database for an abstract entity class.
This was working fine up to Doctrine 2.8
.
The quick fix for those affected is to add "fake" entries to the discriminator map for abstract child entities, that do not have an equivalent in the database ENUM
; which is rather ugly.