diff options
author | Kevin Decherf <kevin@kdecherf.com> | 2020-04-26 15:39:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-26 15:39:57 +0200 |
commit | 0e8a0f77d0b643a884e6687bd9c463267852a970 (patch) | |
tree | 88c6761b4215637bba34b263015e87750c92a187 /src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginUserRuleFixtures.php | |
parent | 8a8a78a64c116caf81aaa4339906298bdc0e32e0 (diff) | |
parent | 71f7e58fbd84e1d15c7a405a3c5872adb937dc37 (diff) | |
download | wallabag-0e8a0f77d0b643a884e6687bd9c463267852a970.tar.gz wallabag-0e8a0f77d0b643a884e6687bd9c463267852a970.tar.zst wallabag-0e8a0f77d0b643a884e6687bd9c463267852a970.zip |
Merge pull request #4026 from wallabag/3760-ignorelist-db
Move Ignore Origin rules to database
Diffstat (limited to 'src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginUserRuleFixtures.php')
-rw-r--r-- | src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginUserRuleFixtures.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginUserRuleFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginUserRuleFixtures.php new file mode 100644 index 00000000..679eff7d --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginUserRuleFixtures.php | |||
@@ -0,0 +1,36 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\DataFixtures; | ||
4 | |||
5 | use Doctrine\Bundle\FixturesBundle\Fixture; | ||
6 | use Doctrine\Common\DataFixtures\DependentFixtureInterface; | ||
7 | use Doctrine\Common\Persistence\ObjectManager; | ||
8 | use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule; | ||
9 | use Wallabag\UserBundle\DataFixtures\UserFixtures; | ||
10 | |||
11 | class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureInterface | ||
12 | { | ||
13 | /** | ||
14 | * {@inheritdoc} | ||
15 | */ | ||
16 | public function load(ObjectManager $manager) | ||
17 | { | ||
18 | $rule = new IgnoreOriginUserRule(); | ||
19 | $rule->setRule('host = "example.fr"'); | ||
20 | $rule->setConfig($this->getReference('admin-user')->getConfig()); | ||
21 | |||
22 | $manager->persist($rule); | ||
23 | |||
24 | $manager->flush(); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * {@inheritdoc} | ||
29 | */ | ||
30 | public function getDependencies() | ||
31 | { | ||
32 | return [ | ||
33 | UserFixtures::class, | ||
34 | ]; | ||
35 | } | ||
36 | } | ||