1
0
mirror of synced 2025-02-21 22:53:15 +03:00

Update UnitOfWork.php

This commit is contained in:
flip111 2015-01-13 20:02:39 +01:00 committed by Marco Pivetta
parent 643ae78691
commit 1ae153d315

View File

@ -834,8 +834,8 @@ class UnitOfWork implements PropertyChangedListener
$targetClass = $this->em->getClassMetadata($assoc['targetEntity']); $targetClass = $this->em->getClassMetadata($assoc['targetEntity']);
foreach ($unwrappedValue as $key => $entry) { foreach ($unwrappedValue as $key => $entry) {
if (! ($entry instanceof $assoc['targetEntity']))) { if (! ($entry instanceof $targetClass->name))) {
throw ORMInvalidArgumentException::invalidAssociation($entry); throw ORMInvalidArgumentException::invalidAssociation($targetClass, $assoc, $entry);
} }
$state = $this->getEntityState($entry, self::STATE_NEW); $state = $this->getEntityState($entry, self::STATE_NEW);