Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-867

QueryBuilder clone only does shallow clone

    Details

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

      Description

      Cloning a QueryBuilder object only performs a shallow clone. This is problematic as object references in the dqlParts array stay the same in cloned copies of a QueryBuilder object.

      For example, say I have a QueryBuilder object with two simple "andWhere" clauses. Now I clone the QueryBuilder instance and add a third "andWhere" clause to the cloned object. The 3rd andWhere clause will also appear in the original QueryBuilder object. The desired behavior is that the original QueryBuilder object is not modified when adding clauses to the cloned copy.

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Fixed

        Show
        Benjamin Eberlei added a comment - Fixed

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Brandon Turner
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: