mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
PersistentCollection::clear() modifies uow for DEFERRED_EXPLICIT change tracking policy #6259
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?
Originally created by @paxal on GitHub (Jun 25, 2019).
Originally assigned to: @lcobucci on GitHub.
Bug Report
Summary
Calling
clear()on a Many-to-many association collection should not modify uow as long aspersist()is not called on owner.This is not the same behavior as calling
removeElement()on each element, which sounds weird.Current behavior
Calling
clear()generates aDELETE FROM table WHERE owner_id = ?statement on aflush().How to reproduce
Mapping :
with PHP code :
Expected behavior
No statement should be executed.
@lcobucci commented on GitHub (Oct 2, 2019):
Handled by #7761