Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-152

Polymorphic queries and fields of subclasses

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0-ALPHA3
    • Fix Version/s: 2.0-ALPHA4
    • Component/s: DQL, ORM
    • Security Level: All
    • Labels:
      None

      Description

      Currently fields of subclasses are added to the ResultSetMapping under the alias of the queried (parent) class. Later during hydration if the queried (parent) class does not own a field AbstractHydrator#_lookupDeclaringClass looks up the first subclass that defines a field with that name. However, multiple subclasses can define a field with the same name, so this is error-prone.

      Fields of subclasses in a polymorphic query should probably be added to the ResultSetMapping with their own alias. The lookup during hydration should be removed and the information which field belongs to which class encoded in the ResultSetMapping.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            Roman S. Borschel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: