mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #10065] Lazy and eager collection refresh inconsistency #12071
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/10065
State: closed
Merged: Yes
When there is a
cascade={"refresh"},EAGERcollections are refreshed,LAZYone are not refreshed, even if initialized...The issue lies in the fact that
\Doctrine\ORM\UnitOfWork::cascadeRefreshis called after the entity holding that collection has been refreshed, thus the lazy collections in there that have been edited are not refreshed (because the initial entity refresh has marked them as not initialized).Moving the
cascadeRefreshbefore the entity is refreshed.. but that might break other things... i'm waiting for github actions to tell.I fear that the same should be done for
\Doctrine\ORM\UnitOfWork::cascadeDetach