blob: 2e1cc2700d20b4a7c51d39753c00429364c8af18 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
<?php
namespace Wallabag\CoreBundle\DataFixtures\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Wallabag\CoreBundle\Entity\TaggingRule;
class LoadTaggingRuleData extends AbstractFixture implements OrderedFixtureInterface
{
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager)
{
$tr1 = new TaggingRule();
$tr1->setRule('content matches "spurs"');
$tr1->setTags(['sport']);
$tr1->setConfig($this->getReference('admin-config'));
$manager->persist($tr1);
$tr2 = new TaggingRule();
$tr2->setRule('content matches "basket"');
$tr2->setTags(['sport']);
$tr2->setConfig($this->getReference('admin-config'));
$manager->persist($tr2);
$manager->flush();
}
/**
* {@inheritdoc}
*/
public function getOrder()
{
return 40;
}
}
|