Skip to content

Commit

Permalink
Reverted PR which broke suite. Issue is still valid, but it requires …
Browse files Browse the repository at this point in the history
…more investigation.
  • Loading branch information
guilhermeblanco committed Nov 23, 2011
1 parent bfcea94 commit ef33454
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Doctrine/ORM/Persisters/SingleTablePersister.php
Expand Up @@ -120,10 +120,10 @@ protected function _getSelectConditionSQL(array $criteria, $assoc = null)
$values[] = $this->_conn->quote($this->_class->discriminatorValue); $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) { foreach ($this->_class->subClasses as $subclassName) {
$values[] = $this->_conn->quote($discrValues[$i]); $values[] = $this->_conn->quote($discrValues[$subclassName]);
} }


$conditionSql .= $this->_getSQLTableAlias($this->_class->name) . '.' . $this->_class->discriminatorColumn['name'] $conditionSql .= $this->_getSQLTableAlias($this->_class->name) . '.' . $this->_class->discriminatorColumn['name']
Expand Down
6 changes: 6 additions & 0 deletions lib/Doctrine/ORM/UnitOfWork.php
Expand Up @@ -2202,6 +2202,12 @@ public function createEntity($className, array $data, &$hints = array())
if (isset($class->associationMappings[$class->identifier[0]])) { if (isset($class->associationMappings[$class->identifier[0]])) {
$idHash = $data[$class->associationMappings[$class->identifier[0]]['joinColumns'][0]['name']]; $idHash = $data[$class->associationMappings[$class->identifier[0]]['joinColumns'][0]['name']];
} else { } 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]]; $idHash = $data[$class->identifier[0]];
} }
$id = array($class->identifier[0] => $idHash); $id = array($class->identifier[0] => $idHash);
Expand Down

0 comments on commit ef33454

Please sign in to comment.