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