From cf941ce54fbe6342b7a3d2d86b33a1d211a20815 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sun, 18 Dec 2016 14:32:31 +0100 Subject: [PATCH] #6174 #5570 documenting thrown exception types --- lib/Doctrine/ORM/UnitOfWork.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 90e30f839..9e213199a 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -1799,7 +1799,7 @@ class UnitOfWork implements PropertyChangedListener * @throws OptimisticLockException If the entity uses optimistic locking through a version * attribute and the version check against the managed copy fails. * @throws ORMInvalidArgumentException If the entity instance is NEW. - * @throws EntityNotFoundException + * @throws EntityNotFoundException if an assigned identifier is used in the entity, but none is provided */ private function doMerge($entity, array &$visited, $prevManagedCopy = null, $assoc = null) { @@ -1891,6 +1891,15 @@ class UnitOfWork implements PropertyChangedListener return $managedCopy; } + /** + * @param ClassMetadata $class + * @param object $entity + * @param object $managedCopy + * + * @return void + * + * @throws OptimisticLockException + */ private function ensureVersionMatch(ClassMetadata $class, $entity, $managedCopy) { if ($class->isVersioned && $this->isLoaded($managedCopy) && $this->isLoaded($entity)) {