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