Code Duplication    Length = 15-16 lines in 2 locations

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

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