Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2157

@HasLifecycleCallbacks does not fire events when set on @MappedSuperclass

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Invalid
    • Affects Version/s: 2.2.3
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Environment:
      Windows 7 x64 / Apache 2.4.2 / MySQL server 5.1.62

      Description

      I am unable to fire any of the "HasLifecycleCallbacks" when defined on a MappedSuperclass... (neither PreUpdate, PostUpdate,PrePersist, PostPersist and others)

      I have even tried to put @ORM\HasLifecycleCallbacks on the child class with onPostRemove() on mapped => not working anymore

      It only works when i put @ORM\HasLifecycleCallbacks and onPostRemove() both in child class "MyMappedTask"...

      Is this a bug ..?

      To reproduce :

      <?php
      namespace MyProject\Entity;
      
      use Doctrine\ORM\Mapping as ORM;
      
      /**
       * @ORM\MappedSuperclass
       * @ORM\HasLifecycleCallbacks
       */
      class MyMappedTask
      {
         /**
          * @ORM\PreRemove
          * @ORM\PostRemove
          * @ORM\PreUpdate
          * @ORM\PostUpdate
           */
          public function onPostRemove()
          {
              echo "here is never reached !";
          }
      }
      
      /**
       * @ORM\Entity(repositoryClass="MyProject\Repository\MyTaskRepository")
       * @ORM\Table()
       */
      class MyTask extends MyMappedTask
      {
      
      }
      

        Activity

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Frederic
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: