Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-531

Collections broken in self-referenced Entities

    Details

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

      Description

      When dealing with parent / children entities, the UnitOfWork does not always hydrate all data correctly.

      This example generates Group1 and its child Group2. Then Clears the Entity Manager, loads Group2 (so it is in the EM), loads Group1 and then the children of Group1 (Group2 is the child of Group1).
      However the children of Group1 cannot be loaded, because $group4->children is not there:

      Warning: Invalid argument supplied for foreach() in /Users/nico/Projects/test/test.php on line 20

      When calling Debug::dump($group4), I get this:

      object(stdClass)#56 (2) {
        ["__CLASS__"]=>
        string(26) "Proxies\EntitiesGroupProxy"
        ["id"]=>
        string(1) "1"
      }
      

      test.php
      http://pastebin.com/7Q3wwtn6

      Group entity:
      http://pastebin.com/hBj2Emrf

        Activity

        Nico Kaiser created issue -
        Nico Kaiser made changes -
        Field Original Value New Value
        Attachment DDC531Test.php [ 10583 ]
        Roman S. Borschel made changes -
        Fix Version/s 2.0-BETA2 [ 10050 ]
        Roman S. Borschel made changes -
        Assignee Roman S. Borschel [ romanb ] Christian Heinrich [ shurakai ]
        Christian Heinrich made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Christian Heinrich made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]
        Nico Kaiser made changes -
        Resolution Invalid [ 6 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Nico Kaiser made changes -
        Attachment DDC531Test.php [ 10606 ]
        Nico Kaiser made changes -
        Attachment DDC531Test.php [ 10583 ]
        Roman S. Borschel made changes -
        Assignee Christian Heinrich [ shurakai ] Roman S. Borschel [ romanb ]
        Roman S. Borschel made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 11247 ] jira-feedback [ 15619 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 15619 ] jira-feedback2 [ 17483 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17483 ] jira-feedback3 [ 19740 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: