]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php
manage assets through npm
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / DataFixtures / ORM / LoadTaggingRuleData.php
CommitLineData
fc031e57
JB
1<?php
2
3namespace Wallabag\CoreBundle\DataFixtures\ORM;
4
5use Doctrine\Common\DataFixtures\AbstractFixture;
6use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
7use Doctrine\Common\Persistence\ObjectManager;
8use Wallabag\CoreBundle\Entity\TaggingRule;
9
10class LoadTaggingRuleData extends AbstractFixture implements OrderedFixtureInterface
11{
12 /**
13 * {@inheritdoc}
14 */
15 public function load(ObjectManager $manager)
16 {
17 $tr1 = new TaggingRule();
18 $tr1->setRule('content matches "spurs"');
4094ea47 19 $tr1->setTags(['sport']);
fc031e57
JB
20 $tr1->setConfig($this->getReference('admin-config'));
21
22 $manager->persist($tr1);
23
24 $tr2 = new TaggingRule();
25 $tr2->setRule('content matches "basket"');
4094ea47 26 $tr2->setTags(['sport']);
fc031e57
JB
27 $tr2->setConfig($this->getReference('admin-config'));
28
29 $manager->persist($tr2);
30
5ecdfcd0
TC
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
fc031e57
JB
39 $manager->flush();
40 }
41
42 /**
43 * {@inheritdoc}
44 */
45 public function getOrder()
46 {
47 return 40;
48 }
49}