mc-cms-namelessmc/dev/scripts/seeder/ProfileFieldsSeeder.php
tadhgboyle 0c80570609
Enable StyleCI (#3475)
* Create StyleCI config file

* Disable `phpdoc_separation`

* Apply fixes from StyleCI (#3476)

Co-authored-by: StyleCI Bot <bot@styleci.io>

* style: styleci fixes

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Sam <samerton@users.noreply.github.com>
2024-03-09 11:19:55 +00:00

24 lines
773 B
PHP

<?php
class ProfileFieldsSeeder extends Seeder
{
public array $tables = [
'nl2_profile_fields',
];
protected function run(DB $db, \Faker\Generator $faker): void
{
$this->times(PROFILE_FIELDS_COUNT, function () use ($db, $faker) {
$db->insert('profile_fields', [
'name' => $faker->unique()->word,
'type' => $faker->randomElement([Fields::TEXT, Fields::TEXTAREA, Fields::DATE]),
'public' => $faker->boolean(75),
'required' => $faker->boolean,
'description' => $faker->sentence,
'length' => null,
'forum_posts' => $faker->boolean(75),
'editable' => $faker->boolean,
]);
});
}
}