Closed
Description
Hi, after upgrading to 2.9 (from 2.8) I now get an error when validating my schema
My setup is the following
Parent
/**
* @ORM\Entity
* @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorColumn(name="discriminant", type="string")
* @ORM\DiscriminatorMap({
* "type_child_a" = ChildA::class,
* "type_child_b" = ChildB::class,
* "other_type" = OtherType::class
* })
*/
abstract class Parent
AbstractType
/**
* @ORM\Entity
*/
abstract class AbstractType extends Parent
ChildA
/**
* @ORM\Entity
*/
class ChildA extends AbstractType
ChildB
/**
* @ORM\Entity
*/
class ChildB extends AbstractType
OtherType
/**
* @ORM\Entity
*/
class OtherType extends Parent
My issue is that after upgrading to 2.9, when validating the schema I now get the error
Entity class 'AbstractType' is part of inheritance hierarchy, but is not mapped in the root entity 'Parent' discriminator map. All subclasses must be listed in the discriminator map.
If I'm not mistaken, doctrine shouldn't expect AbstractType to be in the DiscriminatorMap because it is an abstract class?
If it wasn't supposed to be working before, do you have an alternative to achieve my desired outcome?
Thank you!
Metadata
Metadata
Assignees
Labels
No labels