Code Duplication    Length = 15-16 lines in 2 locations

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

@@ 1128-1142 (lines=15) @@
1125
     * @param array $documents Array of documents to insert
1126
     * @param array $options Array of options to be used with batchInsert()
1127
     */
1128
    private function executeInserts(ClassMetadata $class, array $documents, array $options = array())
1129
    {
1130
        $persister = $this->getDocumentPersister($class->name);
1131
1132
        foreach ($documents as $oid => $document) {
1133
            $persister->addInsert($document);
1134
            unset($this->documentInsertions[$oid]);
1135
        }
1136
1137
        $persister->executeInserts($options);
1138
1139
        foreach ($documents as $document) {
1140
            $this->lifecycleEventManager->postPersist($class, $document);
1141
        }
1142
    }
1143
1144
    /**
1145
     * Executes all document upserts for documents of the specified type.
@@ 1151-1166 (lines=16) @@
1148
     * @param array $documents Array of documents to upsert
1149
     * @param array $options Array of options to be used with batchInsert()
1150
     */
1151
    private function executeUpserts(ClassMetadata $class, array $documents, array $options = array())
1152
    {
1153
        $persister = $this->getDocumentPersister($class->name);
1154
1155
1156
        foreach ($documents as $oid => $document) {
1157
            $persister->addUpsert($document);
1158
            unset($this->documentUpserts[$oid]);
1159
        }
1160
1161
        $persister->executeUpserts($options);
1162
1163
        foreach ($documents as $document) {
1164
            $this->lifecycleEventManager->postPersist($class, $document);
1165
        }
1166
    }
1167
1168
    /**
1169
     * Executes all document updates for documents of the specified type.