Update DatabaseInitializer.php
This commit is contained in:
@@ -234,13 +234,18 @@ class DatabaseInitializer {
|
|||||||
// Bestimmt per Zufall einen Autor aus dem Pool der gültigen E-Mails
|
// Bestimmt per Zufall einen Autor aus dem Pool der gültigen E-Mails
|
||||||
$randomAuthor = $availableEmails[array_rand($availableEmails)];
|
$randomAuthor = $availableEmails[array_rand($availableEmails)];
|
||||||
|
|
||||||
|
// Text in (blocks[i][type]/[text]/[image])-Format umwandeln:
|
||||||
|
$content = json_encode([
|
||||||
|
['type' => 'text', 'value' => $article[1]]
|
||||||
|
], JSON_UNESCAPED_UNICODE);
|
||||||
|
|
||||||
$articleInsertStmt->execute([
|
$articleInsertStmt->execute([
|
||||||
':title' => $article[0],
|
':title' => $article[0],
|
||||||
':content' => $article[1],
|
':content' => $content,
|
||||||
':author' => $randomAuthor,
|
':author' => $randomAuthor,
|
||||||
':category' => $article[2],
|
':category' => $article[2],
|
||||||
':tags' => $article[3]
|
':tags' => $article[3]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user