-
-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DoctrineBundle] deprecate EventSubscriberInterface #1664
[DoctrineBundle] deprecate EventSubscriberInterface #1664
Conversation
f378290
to
a62d7df
Compare
a62d7df
to
9c11976
Compare
9c11976
to
a24a1c3
Compare
Hi, I have the following use case that I needs in one subscriber to listen to multiple events at once class MySubscriber implements EventSubscriberInterface
{
...
public function getSubscribedEvents(): array
{
return array(
Events::postUpdate,
Events::preUpdate,
Events::postLoad,
Events::onFlush,
Events::preFlush,
Events::postFlush,
);
}
} Do I need to declare 6 attributes suggestion: what about create attribute Regards |
Yes, define 6 attributes, I don't see the issue. |
No issue just a question (and suggestion for lazy ones like me 😄) |
…iereguiluz) This PR was squashed before being merged into the 6.3 branch. Discussion ---------- [Doctrine] Deprecate Doctrine lifecycle subscribers Related to symfony/symfony#49918 and doctrine/DoctrineBundle#1664 Commits ------- 77769de [Doctrine] Deprecate Doctrine lifecycle subscribers
Doctrine subscribers are flawed because they force eager loading by design so the goal since symfony/symfony#49918 and #1650 is to push projects to use attributes to register their listeners through autoconfiguration. In order to achieve this goal, this PR propose to deprecate the EventSubscriberInterface available in doctrine/doctrine-bundle.