From 3dc30dee1159bbd9598da6c888bbcee6aaa2f132 Mon Sep 17 00:00:00 2001 From: lenar Date: Thu, 1 Sep 2011 11:29:12 +0300 Subject: [PATCH] use the correct targetEntity --- lib/Doctrine/ORM/Persisters/BasicEntityPersister.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php index a0382a04d..db9f731d2 100644 --- a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php @@ -823,7 +823,7 @@ class BasicEntityPersister if (isset($sourceClass->associationMappings[$field])) { $value = $this->_em->getUnitOfWork()->getEntityIdentifier($value); - $value = $value[$this->_em->getClassMetadata($assoc['targetEntity'])->identifier[0]]; + $value = $value[$this->_em->getClassMetadata($sourceClass->associationMappings[$field]['targetEntity'])->identifier[0]]; } $criteria[$quotedJoinTable . "." . $relationKeyColumn] = $value; @@ -847,7 +847,7 @@ class BasicEntityPersister if (isset($sourceClass->associationMappings[$field])) { $value = $this->_em->getUnitOfWork()->getEntityIdentifier($value); - $value = $value[$this->_em->getClassMetadata($assoc['targetEntity'])->identifier[0]]; + $value = $value[$this->_em->getClassMetadata($sourceClass->associationMappings[$field]['targetEntity'])->identifier[0]]; } $criteria[$quotedJoinTable . "." . $relationKeyColumn] = $value; @@ -1355,7 +1355,7 @@ class BasicEntityPersister if (isset($sourceClass->associationMappings[$field])) { $value = $this->_em->getUnitOfWork()->getEntityIdentifier($value); - $value = $value[$this->_em->getClassMetadata($assoc['targetEntity'])->identifier[0]]; + $value = $value[$this->_em->getClassMetadata($sourceClass->associationMappings[$field]['targetEntity'])->identifier[0]]; } $criteria[$tableAlias . "." . $targetKeyColumn] = $value;