8000 Querying abstract class in the middle of a hierarchy returns NULL instead of objects · Issue #7059 · doctrine/orm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Querying abstract class in the middle of a hierarchy returns NULL instead of objects #7059
Closed
@BenMorel

Description

@BenMorel

I have the following entity hierarchy:

  • (A)
    • B
    • (C)
      • D
      • E

Abstract classes are in parentheses.

When querying entities of class A, B, D or E, everything works fine.
When querying entities of class C however, Doctrine 2.6.0 returns null instead of the entity object.

I created a test case here:
https://github.com/BenMorel/doctrine-abstract-entity-bug

The script creates 3 concrete entities of classes B, D and E, then queries every class of the hierarchy.
Doctrine 2.5.14 returns the correct result:

Bug\A:
    Bug\E
    Bug\D
    Bug\B
Bug\B:
    Bug\B
Bug\C:
    Bug\E
    Bug\D
Bug\D:
    Bug\D
Bug\E:
    Bug\E

Doctrine 2.6.0, however, fails here:

Bug\A:
    Bug\E
    Bug\D
    Bug\B
Bug\B:
    Bug\B
Bug\C:
    NULL          <!>
    NULL          <!>
Bug\D:
    Bug\D
Bug\E:
    Bug\E

As you can see, querying entities of class Bug\C returns NULL and NULL, instead of Bug\D and Bug\E as expected.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0