@@ 1052-1066 (lines=15) @@ | ||
1049 | * @param array $documents Array of documents to insert |
|
1050 | * @param array $options Array of options to be used with batchInsert() |
|
1051 | */ |
|
1052 | private function executeInserts(ClassMetadata $class, array $documents, array $options = array()) |
|
1053 | { |
|
1054 | $persister = $this->getDocumentPersister($class->name); |
|
1055 | ||
1056 | foreach ($documents as $oid => $document) { |
|
1057 | $persister->addInsert($document); |
|
1058 | unset($this->documentInsertions[$oid]); |
|
1059 | } |
|
1060 | ||
1061 | $persister->executeInserts($options); |
|
1062 | ||
1063 | foreach ($documents as $document) { |
|
1064 | $this->lifecycleEventManager->postPersist($class, $document); |
|
1065 | } |
|
1066 | } |
|
1067 | ||
1068 | /** |
|
1069 | * Executes all document upserts for documents of the specified type. |
|
@@ 1075-1090 (lines=16) @@ | ||
1072 | * @param array $documents Array of documents to upsert |
|
1073 | * @param array $options Array of options to be used with batchInsert() |
|
1074 | */ |
|
1075 | private function executeUpserts(ClassMetadata $class, array $documents, array $options = array()) |
|
1076 | { |
|
1077 | $persister = $this->getDocumentPersister($class->name); |
|
1078 | ||
1079 | ||
1080 | foreach ($documents as $oid => $document) { |
|
1081 | $persister->addUpsert($document); |
|
1082 | unset($this->documentUpserts[$oid]); |
|
1083 | } |
|
1084 | ||
1085 | $persister->executeUpserts($options); |
|
1086 | ||
1087 | foreach ($documents as $document) { |
|
1088 | $this->lifecycleEventManager->postPersist($class, $document); |
|
1089 | } |
|
1090 | } |
|
1091 | ||
1092 | /** |
|
1093 | * Executes all document updates for documents of the specified type. |