@@ 1094-1108 (lines=15) @@ | ||
1091 | * @param array $documents Array of documents to insert |
|
1092 | * @param array $options Array of options to be used with batchInsert() |
|
1093 | */ |
|
1094 | private function executeInserts(ClassMetadata $class, array $documents, array $options = array()) |
|
1095 | { |
|
1096 | $persister = $this->getDocumentPersister($class->name); |
|
1097 | ||
1098 | foreach ($documents as $oid => $document) { |
|
1099 | $persister->addInsert($document); |
|
1100 | unset($this->documentInsertions[$oid]); |
|
1101 | } |
|
1102 | ||
1103 | $persister->executeInserts($options); |
|
1104 | ||
1105 | foreach ($documents as $document) { |
|
1106 | $this->lifecycleEventManager->postPersist($class, $document); |
|
1107 | } |
|
1108 | } |
|
1109 | ||
1110 | /** |
|
1111 | * Executes all document upserts for documents of the specified type. |
|
@@ 1117-1132 (lines=16) @@ | ||
1114 | * @param array $documents Array of documents to upsert |
|
1115 | * @param array $options Array of options to be used with batchInsert() |
|
1116 | */ |
|
1117 | private function executeUpserts(ClassMetadata $class, array $documents, array $options = array()) |
|
1118 | { |
|
1119 | $persister = $this->getDocumentPersister($class->name); |
|
1120 | ||
1121 | ||
1122 | foreach ($documents as $oid => $document) { |
|
1123 | $persister->addUpsert($document); |
|
1124 | unset($this->documentUpserts[$oid]); |
|
1125 | } |
|
1126 | ||
1127 | $persister->executeUpserts($options); |
|
1128 | ||
1129 | foreach ($documents as $document) { |
|
1130 | $this->lifecycleEventManager->postPersist($class, $document); |
|
1131 | } |
|
1132 | } |
|
1133 | ||
1134 | /** |
|
1135 | * Executes all document updates for documents of the specified type. |