Skip to content
Browse files

Reverted PR which broke suite. Issue is still valid, but it requires …

…more investigation.
  • Loading branch information...
1 parent bfcea94 commit ef33454301a5fdd5579a04968a4f56b48d25d844 @guilhermeblanco guilhermeblanco committed Nov 23, 2011
Showing with 9 additions and 3 deletions.
  1. +3 −3 lib/Doctrine/ORM/Persisters/SingleTablePersister.php
  2. +6 −0 lib/Doctrine/ORM/UnitOfWork.php
View
6 lib/Doctrine/ORM/Persisters/SingleTablePersister.php
@@ -120,10 +120,10 @@ protected function _getSelectConditionSQL(array $criteria, $assoc = null)
$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']
View
6 lib/Doctrine/ORM/UnitOfWork.php
@@ -2202,6 +2202,12 @@ public function createEntity($className, array $data, &$hints = array())
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);

0 comments on commit ef33454

Please sign in to comment.
Something went wrong with that request. Please try again.