Permalink
Browse files

Merge pull request #202 from realestateconz/master

Fixed array flip breaking discriminator map SQL generation
  • Loading branch information...
2 parents be4eb63 + b80ef58 commit bfcea9460b9e9e713770c12749723e0b546a55fa @guilhermeblanco guilhermeblanco committed Nov 23, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 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 bfcea94

Please sign in to comment.