mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #10786] Fix attach entity listener when reset class metadata factory #12613
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/doctrine/orm/pull/10786
State: closed
Merged: Yes
When resetting entity manager via registry, if we use
Doctrine\ORM\Tools\AttachEntityListenersListenerto add entity event listeners, it can not be reattached because it delete listener after add on the first time then we will lose all entity listeners after reset entity manager.Symfony entity listener example:
and console command execution:
Expect
It work!should be printed twice but only once.