DDC-3287: PreUpdateEventArgs need to extend Doctrine\Common\PreUpdateEventArgs #4065

Open
opened 2026-01-22 14:34:36 +01:00 by admin · 6 comments
Owner

Originally created by @doctrinebot on GitHub (Aug 29, 2014).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user zebba:

Currently the inheritance tree of the EventArgs don't allow for creating event listeners that fit both ORM- and MongoDB-driven applications.

Doctrine\Common defines base classes for Lifecycle event arguments. Doctrine\ORM uses the common library and extends it's classes. So does MongoDB. If you wanted to write something that suits both ORM and MongoDB you should be able to rely on the Common-implementations.

The provided classes to extend:

  • Doctrine\Common\Persistence\Event\LifecycleEventArgs
  • Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs
  • Doctrine\Common\Persistence\Event\ManagerEventArgs
  • Doctrine\Common\Persistence\Event\OnClearEventArgs
  • Doctrine\Common\Persistence\Event\PreUpdateEventArgs

Checking the Github repository there is no common ground for the inheritance mechanism.

  • Doctrine\ORM\Event\LifecycleEventArgs extends Doctrine\Common\Persistence\Event\LifecycleEventArgs
  • Doctrine\ORM\Event\PreUpdateEventArgs extends Doctrine\ORM\Event\LifecycleEventArgs
  • Doctrine\ORM\Event\PreFlushEventArgs extends Doctrine\Common\EventArgs
  • Doctrine\ORM\Event\PostFlushEventArgs extends Doctrine\Common\EventArgs
  • Doctrine\ORM\Event\OnFlushEventArgs extends Doctrine\Common\EventArgs
  • Doctrine\ORM\Event\OnClearEventArgs extends Doctrine\Common\EventArgs

This needs to change and ORM\PreUpdateEventArgs as well as ORM\OnClearEventArgs need to extend the respective events from Doctrine\Common.

Originally created by @doctrinebot on GitHub (Aug 29, 2014). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user zebba: Currently the inheritance tree of the EventArgs don't allow for creating event listeners that fit both ORM- and MongoDB-driven applications. Doctrine\Common defines base classes for Lifecycle event arguments. Doctrine\ORM uses the common library and extends it's classes. So does MongoDB. If you wanted to write something that suits both ORM and MongoDB you should be able to rely on the Common-implementations. The [provided classes](https://github.com/doctrine/common/tree/master/lib/Doctrine/Common/Persistence/Event) to extend: - Doctrine\Common\Persistence\Event\LifecycleEventArgs - Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs - Doctrine\Common\Persistence\Event\ManagerEventArgs - Doctrine\Common\Persistence\Event\OnClearEventArgs - Doctrine\Common\Persistence\Event\PreUpdateEventArgs Checking the [Github repository ](https://github.com/doctrine/doctrine2/tree/master/lib/Doctrine/ORM/Event) there is no common ground for the inheritance mechanism. - Doctrine\ORM\Event\LifecycleEventArgs extends Doctrine\Common\Persistence\Event\LifecycleEventArgs - Doctrine\ORM\Event\PreUpdateEventArgs extends Doctrine\ORM\Event\LifecycleEventArgs - Doctrine\ORM\Event\PreFlushEventArgs extends Doctrine\Common\EventArgs - Doctrine\ORM\Event\PostFlushEventArgs extends Doctrine\Common\EventArgs - Doctrine\ORM\Event\OnFlushEventArgs extends Doctrine\Common\EventArgs - Doctrine\ORM\Event\OnClearEventArgs extends Doctrine\Common\EventArgs This needs to change and ORM\PreUpdateEventArgs as well as ORM\OnClearEventArgs need to extend the respective events from Doctrine\Common.
admin added the Improvement label 2026-01-22 14:34:36 +01:00
Author
Owner

@doctrinebot commented on GitHub (Aug 29, 2014):

@doctrinebot commented on GitHub (Aug 29, 2014): - relates to [DDC-3320: [GH-1144] [DDC-3287] Change parent classes of some Events](http://www.doctrine-project.org/jira/browse/DDC-3320)
Author
Owner

@doctrinebot commented on GitHub (Sep 23, 2014):

Comment created by zebba:

See https://github.com/doctrine/doctrine2/pull/1144

@doctrinebot commented on GitHub (Sep 23, 2014): Comment created by zebba: See https://github.com/doctrine/doctrine2/pull/1144
Author
Owner

@doctrinebot commented on GitHub (Oct 4, 2014):

Comment created by stof:

All flush event args should be updated to extend ManagerEventArgs (and marking their getEntityManager method as deprecated too)

@doctrinebot commented on GitHub (Oct 4, 2014): Comment created by stof: All flush event args should be updated to extend ManagerEventArgs (and marking their `getEntityManager` method as deprecated too)
Author
Owner

@doctrinebot commented on GitHub (Oct 4, 2014):

Comment created by stof:

to be clear, the change on PreUpdateEventArgs cannot be done until 3.0 because of BC

@doctrinebot commented on GitHub (Oct 4, 2014): Comment created by stof: to be clear, the change on `PreUpdateEventArgs` cannot be done until 3.0 because of BC
Author
Owner

@doctrinebot commented on GitHub (Oct 19, 2014):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1144] was assigned:
https://github.com/doctrine/doctrine2/pull/1144

@doctrinebot commented on GitHub (Oct 19, 2014): Comment created by @doctrinebot: A related Github Pull-Request [GH-1144] was assigned: https://github.com/doctrine/doctrine2/pull/1144
Author
Owner

@doctrinebot commented on GitHub (Jan 15, 2015):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1144] was closed:
https://github.com/doctrine/doctrine2/pull/1144

@doctrinebot commented on GitHub (Jan 15, 2015): Comment created by @doctrinebot: A related Github Pull-Request [GH-1144] was closed: https://github.com/doctrine/doctrine2/pull/1144
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4065