[2.0] Refactored UoW#createEntity slightly for perf. reasons (documented properly now).
This commit is contained in:
parent
8fbcf7d571
commit
74a4328833
1 changed files with 5 additions and 1 deletions
|
@ -1808,7 +1808,11 @@ class UnitOfWork implements PropertyChangedListener
|
|||
$newValue = $assoc->load($entity, null, $this->_em, $associatedId);
|
||||
} else {
|
||||
$newValue = $this->_em->getProxyFactory()->getProxy($assoc->targetEntityName, $associatedId);
|
||||
$this->registerManaged($newValue, $associatedId, array());
|
||||
// PERF: Inlined & optimized code from UnitOfWork#registerManaged()
|
||||
$newValueOid = spl_object_hash($newValue);
|
||||
$this->_entityIdentifiers[$newValueOid] = $associatedId;
|
||||
$this->_identityMap[$targetClass->rootEntityName][$relatedIdHash] = $newValue;
|
||||
$this->_entityStates[$newValueOid] = self::STATE_MANAGED;
|
||||
}
|
||||
}
|
||||
$this->_originalEntityData[$oid][$field] = $newValue;
|
||||
|
|
Loading…
Add table
Reference in a new issue