Code Duplication    Length = 15-16 lines in 2 locations

lib/Doctrine/ODM/MongoDB/UnitOfWork.php 2 locations

@@ 1102-1116 (lines=15) @@
1099
     * @param array $documents Array of documents to insert
1100
     * @param array $options Array of options to be used with batchInsert()
1101
     */
1102
    private function executeInserts(ClassMetadata $class, array $documents, array $options = array())
1103
    {
1104
        $persister = $this->getDocumentPersister($class->name);
1105
1106
        foreach ($documents as $oid => $document) {
1107
            $persister->addInsert($document);
1108
            unset($this->documentInsertions[$oid]);
1109
        }
1110
1111
        $persister->executeInserts($options);
1112
1113
        foreach ($documents as $document) {
1114
            $this->lifecycleEventManager->postPersist($class, $document);
1115
        }
1116
    }
1117
1118
    /**
1119
     * Executes all document upserts for documents of the specified type.
@@ 1125-1140 (lines=16) @@
1122
     * @param array $documents Array of documents to upsert
1123
     * @param array $options Array of options to be used with batchInsert()
1124
     */
1125
    private function executeUpserts(ClassMetadata $class, array $documents, array $options = array())
1126
    {
1127
        $persister = $this->getDocumentPersister($class->name);
1128
1129
1130
        foreach ($documents as $oid => $document) {
1131
            $persister->addUpsert($document);
1132
            unset($this->documentUpserts[$oid]);
1133
        }
1134
1135
        $persister->executeUpserts($options);
1136
1137
        foreach ($documents as $document) {
1138
            $this->lifecycleEventManager->postPersist($class, $document);
1139
        }
1140
    }
1141
1142
    /**
1143
     * Executes all document updates for documents of the specified type.