diff --git a/lib/Doctrine/ODM/MongoDB/UnitOfWork.php b/lib/Doctrine/ODM/MongoDB/UnitOfWork.php index e96fc855d4..17ec08e258 100644 --- a/lib/Doctrine/ODM/MongoDB/UnitOfWork.php +++ b/lib/Doctrine/ODM/MongoDB/UnitOfWork.php @@ -1109,58 +1109,6 @@ private function getCommitOrder(array $documentChangeSet = null) return $calc->getCommitOrder(); } -/* -private function getCommitOrder(array $entityChangeSet = null) -{ - if ($entityChangeSet === null) { - $entityChangeSet = array_merge( - $this->entityInsertions, - $this->entityUpdates, - $this->entityDeletions - ); - } - - $calc = $this->getCommitOrderCalculator(); - - // See if there are any new classes in the changeset, that are not in the - // commit order graph yet (dont have a node). - $newNodes = array(); - foreach ($entityChangeSet as $oid => $entity) { - $className = get_class($entity); - if ( ! $calc->hasClass($className)) { - $class = $this->em->getClassMetadata($className); - $calc->addClass($class); - $newNodes[] = $class; - } - } - - // Calculate dependencies for new nodes - foreach ($newNodes as $class) { - foreach ($class->associationMappings as $assoc) { - if ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) { - $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); - if ( ! $calc->hasClass($targetClass->name)) { - $calc->addClass($targetClass); - } - $calc->addDependency($targetClass, $class); - // If the target class has mapped subclasses, - // these share the same dependency. - if ($targetClass->subClasses) { - foreach ($targetClass->subClasses as $subClassName) { - $targetSubClass = $this->em->getClassMetadata($subClassName); - if ( ! $calc->hasClass($subClassName)) { - $calc->addClass($targetSubClass); - } - $calc->addDependency($targetSubClass, $class); - } - } - } - } - } - - return $calc->getCommitOrder(); -} -*/ /** * Add dependencies recursively through embedded documents. Embedded documents * may have references to other documents so those need to be saved first.