1
0
mirror of synced 2024-12-13 14:56:01 +03:00
This commit is contained in:
zYne 2007-05-29 18:33:22 +00:00
parent 063d0f876d
commit 1b891324c9

View File

@ -834,9 +834,11 @@ class Doctrine_Hydrate implements Serializable
if ( ! isset($currData[$alias])) {
$currData[$alias] = array();
}
if ( ! isset($prev[$alias])) {
$prev[$alias] = array();
}
}
if ($alias !== $lastAlias || $parse) {
// component changed
@ -849,6 +851,7 @@ class Doctrine_Hydrate implements Serializable
$array[$index] = $driver->getElement($currData[$alias], $componentName);
$prev[$alias] =& $array[$index];
$index++;
}
}
@ -857,11 +860,16 @@ class Doctrine_Hydrate implements Serializable
$relation = $this->_aliasMap[$cache[$key]['alias']]['relation'];
if ( ! isset($prevData[$alias]) || $currData[$alias] !== $prevData[$alias]) {
// check the type of the relation
if ( ! $relation->isOneToOne()) {
$prev[$parent][$component][] = $driver->getElement($currData[$alias], $componentName);
} else {
$prev[$parent][$component] = $driver->getElement($currData[$alias], $componentName);
if ( ! empty($currData[$alias])) {
// check the type of the relation
if ( ! $relation->isOneToOne()) {
$prev[$parent][$component][] = $driver->getElement($currData[$alias], $componentName);
$driver->registerCollection($prev[$parent][$component]);
} else {
$prev[$parent][$component] = $driver->getElement($currData[$alias], $componentName);
}
}
}
}
@ -905,6 +913,7 @@ class Doctrine_Hydrate implements Serializable
// check the type of the relation
if ( ! $relation->isOneToOne()) {
$prev[$parent][$component][] = $driver->getElement($currData[$alias], $componentName);
$driver->registerCollection($prev[$parent][$component]);
} else {
$prev[$parent][$component] = $driver->getElement($currData[$alias], $componentName);
}