2019-06-23 22:13:44 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Wallabag\CoreBundle\DataFixtures;
|
|
|
|
|
|
|
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
|
|
|
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
2020-06-15 08:25:59 +02:00
|
|
|
use Doctrine\Persistence\ObjectManager;
|
2019-06-23 22:13:44 +02:00
|
|
|
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
|
|
|
|
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
|
|
|
|
|
|
|
class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
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"');
|
|
|
|
$rule->setConfig($this->getReference('admin-user')->getConfig());
|
|
|
|
|
|
|
|
$manager->persist($rule);
|
|
|
|
|
|
|
|
$manager->flush();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
public function getDependencies()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
UserFixtures::class,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|