From 1ae153d3151492f9f1e620a2c1a55409f4b7d870 Mon Sep 17 00:00:00 2001 From: flip111 Date: Tue, 13 Jan 2015 20:02:39 +0100 Subject: [PATCH] Update UnitOfWork.php --- lib/Doctrine/ORM/UnitOfWork.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 3ac943cba..6bc964d0e 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -834,8 +834,8 @@ class UnitOfWork implements PropertyChangedListener $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); foreach ($unwrappedValue as $key => $entry) { - if (! ($entry instanceof $assoc['targetEntity']))) { - throw ORMInvalidArgumentException::invalidAssociation($entry); + if (! ($entry instanceof $targetClass->name))) { + throw ORMInvalidArgumentException::invalidAssociation($targetClass, $assoc, $entry); } $state = $this->getEntityState($entry, self::STATE_NEW);