Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-837

Two children in inheritance with same property name causes error in hydration

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA4
    • Fix Version/s: 2.0.1, 2.1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      This is related to DDC-258. The issue seems to be fixed with regular column types (string, int, etc) but the same issue has cropped up when we have a OneToOne relationship in two child classes that share the same property name. I have modified the DDC258TestCase class to demonstrate the error.

      To summarize: two classes that inherit from the same class happen to have a property with the same name. Both of them are oneToOne relationships. Querying for the objects, one object type (depending on discriminatorMap order) will be hydrate correctly but the other will always be null.

        Activity

        Hide
        Benjamin Eberlei added a comment -

        This is not a bug, its documented behavior and is technically not feasible.

        Show
        Benjamin Eberlei added a comment - This is not a bug, its documented behavior and is technically not feasible.
        Hide
        Michael Ridgway added a comment -

        Why would this not be feasible on relationships even though it is on regular column types? I feel like this is the same issue as DDC-258. I understand a child can't have a property named the same as the parent's, but two children should be able to have properties with the same name (and currently can if it's not a relationship).

        Show
        Michael Ridgway added a comment - Why would this not be feasible on relationships even though it is on regular column types? I feel like this is the same issue as DDC-258 . I understand a child can't have a property named the same as the parent's, but two children should be able to have properties with the same name (and currently can if it's not a relationship).
        Hide
        Benjamin Eberlei added a comment -

        oh maybe i am wrong

        Show
        Benjamin Eberlei added a comment - oh maybe i am wrong
        Hide
        Benjamin Eberlei added a comment -

        Fixed

        Show
        Benjamin Eberlei added a comment - Fixed

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Michael Ridgway
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: