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