8000 Regression: abstract entities in the middle of a hierarchy need to be part of discriminator map · Issue #9095 · doctrine/orm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Regression: abstract entities in the middle of a hierarchy need to be part of discriminator map #9095
@BenMorel

Description

@BenMorel

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0