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