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 27, 2017
1 parent c7cde75 commit 9d21362
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 @@ -2062,12 +2062,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 9d21362

Please sign in to comment.