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