2019-06-23 22:13:44 +02:00
|
|
|
<?php
|
|
|
|
|
2024-02-19 01:30:12 +01:00
|
|
|
namespace Wallabag\DataFixtures;
|
2019-06-23 22:13:44 +02:00
|
|
|
|
|
|
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
|
|
|
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
2020-06-15 08:25:59 +02:00
|
|
|
use Doctrine\Persistence\ObjectManager;
|
2024-02-19 01:30:12 +01:00
|
|
|
use Wallabag\Entity\IgnoreOriginUserRule;
|
|
|
|
use Wallabag\Entity\User;
|
2019-06-23 22:13:44 +02:00
|
|
|
|
|
|
|
class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureInterface
|
|
|
|
{
|
2020-06-15 08:25:59 +02:00
|
|
|
public function load(ObjectManager $manager): void
|
2019-06-23 22:13:44 +02:00
|
|
|
{
|
|
|
|
$rule = new IgnoreOriginUserRule();
|
|
|
|
$rule->setRule('host = "example.fr"');
|
2023-08-05 18:25:03 +02:00
|
|
|
$rule->setConfig($this->getReference('admin-user', User::class)->getConfig());
|
2019-06-23 22:13:44 +02:00
|
|
|
|
|
|
|
$manager->persist($rule);
|
|
|
|
|
|
|
|
$manager->flush();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getDependencies()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
UserFixtures::class,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|