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