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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: