mapguesser/database/migrations/data/20230923_1905_username.php

14 lines
380 B
PHP
Raw Normal View History

2023-09-24 00:35:15 +02:00
<?php
use Faker\Factory;
use MapGuesser\PersistentData\Model\User;
use SokoWeb\Database\Query\Select;
$select = new Select(Container::$dbConnection);
$users = Container::$persistentDataManager->selectMultipleFromDb($select, User::class);
foreach ($users as $user) {
$user->setUsername(Factory::create()->userName);
Container::$persistentDataManager->saveToDb($user);
}