Doctrine MongoDB ODM
  1. Doctrine MongoDB ODM
  2. MODM-74

lifecycleCallbacks are not inherited from mappedSuperclass in yaml mapping

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0BETA2
    • Component/s: Mapping Drivers
    • Labels:
      None

      Description

      The abstract class :

      abstract class Cgd\DomainObject\DomainObjectAbstract

      mappedSuperclass
      #Cgd.DomainObject.DomainObjectAbstract.dcm.yml
      Cgd\DomainObject\DomainObjectAbstract:
        type: mappedSuperclass
        fields:
          id:
            fieldName: id
            id: true
          createdAt:
            fieldName: createdAt
            type: date
          updatedAt:
            fieldName: updatedAt
            type: date
        lifecycleCallbacks:
          prePersist: [onPreInsert]
          preUpdate: [onPreUpdate]
      

      Here the inherited class

      class App\Entity\Contact\Contact extends Cgd\DomainObject\DomainObjectAbstract

      InheritedClass
      #App.Entity.Contact.Contact.dcm.yml
      App\Entity\Contact\Contact:
        collection: contacts
        type: document
        fields:
          email:
            fieldName: email
            type: string
          status:
            fieldName: status
            type: int
      

      If i add the lifecycleCallbacks in the InheritedClass yaml config. Events are working

        Activity

        Hide
        julien rollin added a comment -

        fixed in current master branch

        Show
        julien rollin added a comment - fixed in current master branch

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            julien rollin
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: