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