diff --git a/lib/Doctrine/ORM/Persisters/SingleTablePersister.php b/lib/Doctrine/ORM/Persisters/SingleTablePersister.php index b39d3bf75..897900d22 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_flip($this->_class->discriminatorMap); + $discrValues = array_keys($this->_class->discriminatorMap); - foreach ($this->_class->subClasses as $subclassName) { - $values[] = $this->_conn->quote($discrValues[$subclassName]); + foreach ($this->_class->subClasses as $i => $subclassName) { + $values[] = $this->_conn->quote($discrValues[$i]); } $conditionSql .= $this->_getSQLTableAlias($this->_class->name) . '.' . $this->_class->discriminatorColumn['name'] @@ -131,4 +131,4 @@ class SingleTablePersister extends AbstractEntityInheritancePersister return $conditionSql; } -} \ No newline at end of file +}