1
0
mirror of synced 2025-02-20 14:13:15 +03:00

DDC-952 - Woah this still needs tons of tests.

This commit is contained in:
Benjamin Eberlei 2011-03-09 23:30:35 +01:00
parent 595c19207c
commit 8794d35867

View File

@ -1901,6 +1901,8 @@ class UnitOfWork implements PropertyChangedListener
}
}
unset($this->eagerLoadingEntities[$class->name][$idHash]);
// Properly initialize any unfetched associations, if partial objects are not allowed.
if ( ! isset($hints[Query::HINT_FORCE_PARTIAL_LOAD])) {
foreach ($class->associationMappings as $field => $assoc) {
@ -1947,7 +1949,7 @@ class UnitOfWork implements PropertyChangedListener
$newValue instanceof Proxy &&
$newValue->__isInitialized__ === false) {
$this->eagerLoadingEntities[$assoc['targetEntity']][] = $relatedIdHash;
$this->eagerLoadingEntities[$assoc['targetEntity']][$relatedIdHash] = current($associatedId);
}
} else {
if ($targetClass->subClasses) {
@ -1959,7 +1961,7 @@ class UnitOfWork implements PropertyChangedListener
if ($assoc['fetch'] == ClassMetadata::FETCH_EAGER || isset($hints['fetchEager'][$class->name][$field])) {
if (isset($hints['deferEagerLoad']) && !$targetClass->isIdentifierComposite) {
// TODO: Is there a faster approach?
$this->eagerLoadingEntities[$assoc['targetEntity']][] = current($id);
$this->eagerLoadingEntities[$assoc['targetEntity']][$relatedIdHash] = current($associatedId);
$newValue = $this->em->getProxyFactory()->getProxy($assoc['targetEntity'], $associatedId);
} else {