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