1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-06-27 16:36:00 +00:00
wallabag/fixtures/InternalSettingFixtures.php
2025-04-07 09:17:32 +02:00

28 lines
743 B
PHP

<?php
namespace Wallabag\DataFixtures;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Persistence\ObjectManager;
use Wallabag\Entity\InternalSetting;
class InternalSettingFixtures extends Fixture
{
public function __construct(
private readonly array $defaultInternalSettings,
) {
}
public function load(ObjectManager $manager): void
{
foreach ($this->defaultInternalSettings as $setting) {
$newSetting = new InternalSetting();
$newSetting->setName($setting['name']);
$newSetting->setValue($setting['value']);
$newSetting->setSection($setting['section']);
$manager->persist($newSetting);
}
$manager->flush();
}
}