DDC-75: Lifecycle Events are not inherited #89

Open
opened 2026-01-22 12:26:43 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Oct 29, 2009).

Jira issue originally created by user nicokaiser:

When inheriting from classes that have Lifecycle Events (with @HasLifecycleCallbacks), these events are not called anymore.

  • Create an entity, let's say "User"
  • Set up a lifecycle event like "PrePersist"
  • Instantiate a new User and call em->persist(...)
  • The PrePersist function gets called.
  • Now set up @InheritanceType etc. and create a subclass ("SubUser") which can extend User (the class body can be empty)
  • Instantiate a new SubUser and call em->persist(...)
  • The PrePersist function (inherited from User!) does not get called.
Originally created by @doctrinebot on GitHub (Oct 29, 2009). Jira issue originally created by user nicokaiser: When inheriting from classes that have Lifecycle Events (with @HasLifecycleCallbacks), these events are not called anymore. - Create an entity, let's say "User" - Set up a lifecycle event like "PrePersist" - Instantiate a new User and call em->persist(...) - The PrePersist function gets called. - Now set up @InheritanceType etc. and create a subclass ("SubUser") which can extend User (the class body can be empty) - Instantiate a new SubUser and call em->persist(...) - The PrePersist function (inherited from User!) **does not get called**.
admin added the Bug label 2026-01-22 12:26:43 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#89