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

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


    • 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:


      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



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


              • Created: