Commit 3a39bea9 authored by romanb's avatar romanb

[2.0][DDC-171] Fixed.

parent 909e98c6
......@@ -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);
}
}
......
......@@ -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.
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment