]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTaggingRuleData.php
Fix the deletion of Tags/Entries relation when delete an entry
[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
31 $manager->flush();
32 }
33
34 /**
35 * {@inheritdoc}
36 */
37 public function getOrder()
38 {
39 return 40;
40 }
41}