Skip to content

Commit

Permalink
Fix #4252 Cascade first before refreshing the entity itself so toMany…
Browse files Browse the repository at this point in the history
… associations are not reset to empty collections
  • Loading branch information
Zacharias Luiten committed Oct 30, 2017
1 parent a8465a3 commit 9d9f684
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -2095,12 +2095,12 @@ private function doRefresh($entity, array &$visited)
throw ORMInvalidArgumentException::entityNotManaged($entity);
}

$this->cascadeRefresh($entity, $visited);

$this->getEntityPersister($class->name)->refresh(
array_combine($class->getIdentifierFieldNames(), $this->entityIdentifiers[$oid]),
$entity
);

$this->cascadeRefresh($entity, $visited);
}

/**
Expand Down

0 comments on commit 9d9f684

Please sign in to comment.