Skip to content

Commit 9d21362

Browse files
author
Zacharias Luiten
committed
Fix #4252 Cascade first before refreshing the entity itself so toMany associations are not reset to empty collections
1 parent c7cde75 commit 9d21362

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Doctrine/ORM/UnitOfWork.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2062,12 +2062,12 @@ private function doRefresh($entity, array &$visited)
20622062
throw ORMInvalidArgumentException::entityNotManaged($entity);
20632063
}
20642064

2065+
$this->cascadeRefresh($entity, $visited);
2066+
20652067
$this->getEntityPersister($class->name)->refresh(
20662068
array_combine($class->getIdentifierFieldNames(), $this->entityIdentifiers[$oid]),
20672069
$entity
20682070
);
2069-
2070-
$this->cascadeRefresh($entity, $visited);
20712071
}
20722072

20732073
/**

0 commit comments

Comments
 (0)