1
0
mirror of synced 2025-02-20 22:23:14 +03:00

[2.0][DDC-171] Fixed.

This commit is contained in:
romanb 2009-12-09 16:06:39 +00:00
parent 909e98c6f2
commit 3a39bea9f0
3 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,7 @@ class DebugStack implements SqlLogger
public function logSql($sql, array $params = null)
{
if($this->enabled) {
if ($this->enabled) {
$this->queries[] = array('sql' => $sql, 'params' => $params);
}
}

View File

@ -305,7 +305,7 @@ abstract class AbstractHydrator
*/
private function _lookupDeclaringClass($class, $fieldName)
{
//FIXME: What if two subclasses declare a (mapped) field with the same name?
// FIXME: What if two subclasses declare a (mapped) field with the same name?
// We probably need to encode the information to which subclass a field
// belongs in the column alias / result set mapping.
// This would solve the issue and would probably make this lookup superfluous.

View File

@ -354,6 +354,7 @@ class ObjectHydrator extends AbstractHydrator
}
} else {
$targetClass->reflFields[$inverseAssoc->sourceFieldName]->setValue($element, $parentObject);
$this->_uow->setOriginalEntityProperty(spl_object_hash($element), $inverseAssoc->sourceFieldName, $parentObject);
}
} else if ($parentClass === $targetClass && $relation->mappedByFieldName) {
// Special case: bi-directional self-referencing one-one on the same class
@ -362,6 +363,7 @@ class ObjectHydrator extends AbstractHydrator
} else {
// For sure bidirectional, as there is no inverse side in unidirectional mappings
$targetClass->reflFields[$relation->mappedByFieldName]->setValue($element, $parentObject);
$this->_uow->setOriginalEntityProperty(spl_object_hash($element), $relation->mappedByFieldName, $parentObject);
}
// Update result pointer
$this->_resultPointers[$dqlAlias] = $element;