From ef33454301a5fdd5579a04968a4f56b48d25d844 Mon Sep 17 00:00:00 2001 From: Guilherme Blanco Date: Wed, 23 Nov 2011 08:40:47 -0500 Subject: [PATCH] Reverted PR which broke suite. Issue is still valid, but it requires more investigation. --- lib/Doctrine/ORM/Persisters/SingleTablePersister.php | 6 +++--- lib/Doctrine/ORM/UnitOfWork.php | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/ORM/Persisters/SingleTablePersister.php b/lib/Doctrine/ORM/Persisters/SingleTablePersister.php index 897900d22..0f1b9e3de 100644 --- a/lib/Doctrine/ORM/Persisters/SingleTablePersister.php +++ b/lib/Doctrine/ORM/Persisters/SingleTablePersister.php @@ -120,10 +120,10 @@ class SingleTablePersister extends AbstractEntityInheritancePersister $values[] = $this->_conn->quote($this->_class->discriminatorValue); } - $discrValues = array_keys($this->_class->discriminatorMap); + $discrValues = array_flip($this->_class->discriminatorMap); - foreach ($this->_class->subClasses as $i => $subclassName) { - $values[] = $this->_conn->quote($discrValues[$i]); + foreach ($this->_class->subClasses as $subclassName) { + $values[] = $this->_conn->quote($discrValues[$subclassName]); } $conditionSql .= $this->_getSQLTableAlias($this->_class->name) . '.' . $this->_class->discriminatorColumn['name'] diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 91440eacf..0a04d05ae 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -2202,6 +2202,12 @@ class UnitOfWork implements PropertyChangedListener if (isset($class->associationMappings[$class->identifier[0]])) { $idHash = $data[$class->associationMappings[$class->identifier[0]]['joinColumns'][0]['name']]; } else { + /*echo $className; + \Doctrine\Common\Util\Debug::dump($data); + \Doctrine\Common\Util\Debug::dump($class->identifier); + ob_end_flush(); + ob_start();*/ + $idHash = $data[$class->identifier[0]]; } $id = array($class->identifier[0] => $idHash);