mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-15 09:57:41 +01:00
31 lines
766 B
PHP
31 lines
766 B
PHP
<?php
|
|
|
|
namespace Wallabag\DataFixtures;
|
|
|
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
|
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
|
use Doctrine\Persistence\ObjectManager;
|
|
use Wallabag\Entity\IgnoreOriginUserRule;
|
|
use Wallabag\Entity\User;
|
|
|
|
class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureInterface
|
|
{
|
|
public function load(ObjectManager $manager): void
|
|
{
|
|
$rule = new IgnoreOriginUserRule();
|
|
$rule->setRule('host = "example.fr"');
|
|
$rule->setConfig($this->getReference('admin-user', User::class)->getConfig());
|
|
|
|
$manager->persist($rule);
|
|
|
|
$manager->flush();
|
|
}
|
|
|
|
public function getDependencies()
|
|
{
|
|
return [
|
|
UserFixtures::class,
|
|
];
|
|
}
|
|
}
|