MCPcopy Create free account
hub / github.com/Rello/analytics / importDataloads

Method importDataloads

lib/UserMigration/AnalyticsMigrator.php:260–277  ·  view source on GitHub ↗

* @param list > $rows * @param array $datasetMap * @throws Exception */

(string $uid, array $rows, array $datasetMap)

Source from the content-addressed store, hash-verified

258 * @throws Exception
259 */
260 private function importDataloads(string $uid, array $rows, array $datasetMap): void {
261 foreach ($rows as $row) {
262 $oldDataset = isset($row['dataset']) ? (int)$row['dataset'] : 0;
263 $newDataset = $datasetMap[$oldDataset] ?? null;
264 if ($newDataset === null) {
265 continue;
266 }
267
268 $this->insertAndReturnId('analytics_dataload', [
269 'user_id' => $uid,
270 'name' => $row['name'] ?? '',
271 'dataset' => $newDataset,
272 'datasource' => isset($row['datasource']) ? (int)$row['datasource'] : 0,
273 'option' => $row['option'] ?? '{}',
274 'schedule' => $row['schedule'] ?? null,
275 ]);
276 }
277 }
278
279 /**
280 * @param list<array<string,mixed>> $rows

Callers 1

importMethod · 0.95

Calls 1

insertAndReturnIdMethod · 0.95

Tested by

no test coverage detected