Browse files

Fixed array_flip breaking discriminator map SQL generation

  • Loading branch information...
1 parent be4eb63 commit b80ef58cab801d2c6cd3e26d757e047e43b79c1d @warezthebeef warezthebeef committed Nov 23, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/Doctrine/ORM/Persisters/SingleTablePersister.php
View
8 lib/Doctrine/ORM/Persisters/SingleTablePersister.php
@@ -120,15 +120,15 @@ protected function _getSelectConditionSQL(array $criteria, $assoc = null)
$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']
. ' IN (' . implode(', ', $values) . ')';
return $conditionSql;
}
-}
+}

0 comments on commit b80ef58

Please sign in to comment.