aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php
diff options
context:
space:
mode:
authorlizyn <zhiylin@outlook.com>2020-02-24 10:04:13 +0800
committerGitHub <noreply@github.com>2020-02-24 10:04:13 +0800
commitb19df31d78d881a43bcf6b3215e5fc3781e8e8aa (patch)
treed0d9861694a4b5e5fbfdbeb53c255ecd15fe9328 /src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php
parent4d0c632c70ea50d459c3c55ddda2e0f394dd51cb (diff)
parent04d918cae0227c06a41d27fb6533dddbf30dfe71 (diff)
downloadwallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.tar.gz
wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.tar.zst
wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.zip
Merge pull request #1 from wallabag/master
Keep up with the master again
Diffstat (limited to 'src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php')
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php
new file mode 100644
index 00000000..78ff314a
--- /dev/null
+++ b/src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php
@@ -0,0 +1,58 @@
1<?php
2
3namespace Wallabag\CoreBundle\DataFixtures;
4
5use Doctrine\Bundle\FixturesBundle\Fixture;
6use Doctrine\Common\DataFixtures\DependentFixtureInterface;
7use Doctrine\Common\Persistence\ObjectManager;
8use Wallabag\CoreBundle\Entity\TaggingRule;
9
10class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
11{
12 /**
13 * {@inheritdoc}
14 */
15 public function load(ObjectManager $manager)
16 {
17 $tr1 = new TaggingRule();
18 $tr1->setRule('content matches "spurs"');
19 $tr1->setTags(['sport']);
20 $tr1->setConfig($this->getReference('admin-config'));
21
22 $manager->persist($tr1);
23
24 $tr2 = new TaggingRule();
25 $tr2->setRule('content matches "basket"');
26 $tr2->setTags(['sport']);
27 $tr2->setConfig($this->getReference('admin-config'));
28
29 $manager->persist($tr2);
30
31 $tr3 = new TaggingRule();
32
33 $tr3->setRule('title matches "wallabag"');
34 $tr3->setTags(['wallabag']);
35 $tr3->setConfig($this->getReference('admin-config'));
36
37 $manager->persist($tr3);
38
39 $tr4 = new TaggingRule();
40 $tr4->setRule('content notmatches "basket"');
41 $tr4->setTags(['foot']);
42 $tr4->setConfig($this->getReference('admin-config'));
43
44 $manager->persist($tr4);
45
46 $manager->flush();
47 }
48
49 /**
50 * {@inheritdoc}
51 */
52 public function getDependencies()
53 {
54 return [
55 ConfigFixtures::class,
56 ];
57 }
58}