Uploaded image for project: 'Doctrine 2 - ORM'
  1. Doctrine 2 - ORM
  2. DDC-1998

Problem when deleting with EntityManager->remove($entity)

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.3
    • Fix Version/s: 2.4
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      The problem is when using EntityMamager->remove($entity). The Sql query generated doesn't convert the values of the ids according to the field type that is used in doc block annotation. After investigating I found that in Doctrine\DBAL\Connection the function delete doesn't support to receive as param the types of the ids to be given to the executeUpdate function which is called in it and supports them. (The types need to be provided from the persisters from which the delete is called).

      I hope it make sense to you. I got that problem because I am using custom time stamp column type as id. And it converts the value of the field to time stamp string, which if not converted to the proper sql value is not recognised and the delete doesn't go trough.

      As far as I can see it is something that was missed and hope it will be fixed soon.

      If you have any questions please ask.
      Also on request I can provide example code and the fix I have done for myself.

      1. DDC1998Test.php
        3 kB
        Fabio B. Silva
      2. DDC1998Test1.php
        3 kB
        victor Velkov
      3. EwtTimestamp.php
        2 kB
        victor Velkov
      4. ProductTemplate.php
        0.8 kB
        victor Velkov

        Issue Links

          Activity

          vigor_bg victor Velkov created issue -
          vigor_bg victor Velkov made changes -
          Field Original Value New Value
          Attachment EwtTimestamp.php [ 11315 ]
          Attachment ProductTemplate.php [ 11316 ]
          fabio.bat.silva Fabio B. Silva made changes -
          Attachment DDC1998Test.php [ 11325 ]
          fabio.bat.silva Fabio B. Silva made changes -
          Status Open [ 1 ] Awaiting Feedback [ 10000 ]
          vigor_bg victor Velkov made changes -
          Attachment DDC1998Test1.php [ 11335 ]
          vigor_bg victor Velkov made changes -
          Attachment DDC1998Test1.php [ 11335 ]
          vigor_bg victor Velkov made changes -
          Attachment DDC1998Test1.php [ 11336 ]
          Anonymous made changes -
          Status Awaiting Feedback [ 10000 ] In Progress [ 3 ]
          a.barani Andrea Barani made changes -
          Status In Progress [ 3 ] Awaiting Feedback [ 10000 ]
          a.barani Andrea Barani made changes -
          Status Awaiting Feedback [ 10000 ] In Progress [ 3 ]
          ocramius Marco Pivetta made changes -
          Priority Blocker [ 1 ] Minor [ 4 ]
          beberlei Benjamin Eberlei made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Fix Version/s 2.4 [ 10321 ]
          Resolution Fixed [ 1 ]
          ocramius Marco Pivetta made changes -
          Link This issue is duplicated by DDC-2176 [ DDC-2176 ]

            People

            • Assignee:
              beberlei Benjamin Eberlei
              Reporter:
              vigor_bg victor Velkov
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: