diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2019-05-29 11:14:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-29 11:14:00 +0200 |
commit | 73ec68b1ffafb792265a3805833e5cd84c966aed (patch) | |
tree | 33c6040c050f85c537f8dbf5e91d8c281db092cd /src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php | |
parent | 2ba365c7c49556cd23b444dc3bb8d4a8cf08809d (diff) | |
parent | 2cbee36a0184786644470a84fdd8c720cfcac58e (diff) | |
download | wallabag-73ec68b1ffafb792265a3805833e5cd84c966aed.tar.gz wallabag-73ec68b1ffafb792265a3805833e5cd84c966aed.tar.zst wallabag-73ec68b1ffafb792265a3805833e5cd84c966aed.zip |
Merge pull request #3984 from wallabag/2.4
Merge 2.4 into master
Diffstat (limited to 'src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php')
-rw-r--r-- | src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php | 58 |
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 | |||
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\TaggingRule; | ||
9 | |||
10 | class 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 | } | ||