Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Labels:
      None

      Description

      If i have a node that i fetch from the repo using $dm->find()

      If i change an attribute in it.
      Then i call $dm->move() on it

      Then i call $dm->flush().

      It will work.

      However if i call $dm->persist() on the node (that i already fetched from $dm->find()) and then call $dm->flush()
      The $dm->move() won't occur, it will be cancelled, but the attribute i changed will still be updated.

        Activity

        Hide
        Lukas Kahwe added a comment -

        i have to think about if this is a bug or a feature.
        its certainly useful to have a way to "cancel" operations ..
        f.e. persist() also cancels remove()

        then again persist() is i guess viewed by many as a non problematic operation since it commonly doesn't break anything if one persisted an object multiple times.

        Show
        Lukas Kahwe added a comment - i have to think about if this is a bug or a feature. its certainly useful to have a way to "cancel" operations .. f.e. persist() also cancels remove() then again persist() is i guess viewed by many as a non problematic operation since it commonly doesn't break anything if one persisted an object multiple times.
        Hide
        Lukas Kahwe added a comment -

        as i expected this is an intentional feature:
        https://github.com/doctrine/phpcr-odm/blob/master/lib/Doctrine/ODM/PHPCR/UnitOfWork.php#L518

        we could think about adding a dedicated method to "reset" the state, but the ORM doesn't have something like that so i rather not introduce it.

        Show
        Lukas Kahwe added a comment - as i expected this is an intentional feature: https://github.com/doctrine/phpcr-odm/blob/master/lib/Doctrine/ODM/PHPCR/UnitOfWork.php#L518 we could think about adding a dedicated method to "reset" the state, but the ORM doesn't have something like that so i rather not introduce it.

          People

          • Assignee:
            Lukas Kahwe
            Reporter:
            Freddy H.
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: