Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1732

Unserialized non-initialized proxy classes should throw an exception when a method is called

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2, Git Master
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      When we serialize entities in a session, we often have pointers to uninitialized proxies.
      These proxies have $_entityPersister == null.

      The problem is that if you happen to call by mistake a method on such a proxy, you're not aware that this is an uninitialized proxy, and the business methods are called, with null values for every property.

      I think the proxy should throw an exception in that case.
      Attached, a patch with the proposed modification.

        Activity

        Benjamin Morel created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Workflow jira [ 13568 ] jira-feedback [ 14039 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14039 ] jira-feedback2 [ 15903 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 15903 ] jira-feedback3 [ 18158 ]

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Benjamin Morel
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: