mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #989] [CLOSED] Fix the problem when the lifecycle event can be triggered more then once... #9002
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?
📋 Pull Request Information
Original PR: https://github.com/doctrine/orm/pull/989
Author: @dyangrev
Created: 3/26/2014
Status: ❌ Closed
Base:
master← Head:master📝 Commits (1)
26692f1Fix the problem when the lifecycle event can be triggered more then once incorrectly📊 Changes
1 file changed (+12 additions, -0 deletions)
View changed files
📝
lib/Doctrine/ORM/UnitOfWork.php(+12 -0)📄 Description
We recently saw the postUpdate event get trigger multiple time incorrectly, it typically happens when flushing a set of entities persisted whose listener persist and flush another type of entity in it.
Php passes variables to foreach by value, for the function executeUpdates in the UnitOfWork, for example, entities in the $this->entityUpdates could be updated and unset in the listener of the first entity, while them will be updated and trigger listeners again when the process of first entity finishes (although they have already been unset from $this->entityUpdates). Similar for executeInsertion and executeDeletion.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.