* @param list > $rows * @param array $datasetMap * @throws Exception */
(string $uid, array $rows, array $datasetMap, array $columnMaps = [])
| 272 | * @throws Exception |
| 273 | */ |
| 274 | private function importDataloads(string $uid, array $rows, array $datasetMap, array $columnMaps = []): void { |
| 275 | foreach ($rows as $row) { |
| 276 | $oldDataset = isset($row['dataset']) ? (int)$row['dataset'] : 0; |
| 277 | $newDataset = $datasetMap[$oldDataset] ?? null; |
| 278 | if ($newDataset === null) { |
| 279 | continue; |
| 280 | } |
| 281 | |
| 282 | $this->insertAndReturnId('analytics_dataload', [ |
| 283 | 'user_id' => $uid, |
| 284 | 'name' => $row['name'] ?? '', |
| 285 | 'dataset' => $newDataset, |
| 286 | 'datasource' => isset($row['datasource']) ? (int)$row['datasource'] : 0, |
| 287 | 'option' => $row['option'] ?? '{}', |
| 288 | 'schedule' => $row['schedule'] ?? null, |
| 289 | 'storage_mapping' => $this->remapReferenceJson($row['storage_mapping'] ?? null, $columnMaps[$oldDataset] ?? []), |
| 290 | ]); |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | /** |
| 295 | * @param array<string,mixed> $payload |
no test coverage detected