]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php
Merge pull request #3332 from nclsHart/better-txt-export
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / DataFixtures / ORM / LoadTagData.php
CommitLineData
fc732227
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\Tag;
9
10class LoadTagData extends AbstractFixture implements OrderedFixtureInterface
11{
12 /**
13 * {@inheritdoc}
14 */
15 public function load(ObjectManager $manager)
16 {
17 $tag1 = new Tag();
c8de7ab9 18 $tag1->setLabel('foo bar');
fc732227
JB
19
20 $manager->persist($tag1);
21
22 $this->addReference('foo-tag', $tag1);
23
24 $tag2 = new Tag();
25 $tag2->setLabel('bar');
26
27 $manager->persist($tag2);
28
29 $this->addReference('bar-tag', $tag2);
30
267e8d63
NL
31 $tag3 = new Tag();
32 $tag3->setLabel('baz');
33
34 $manager->persist($tag3);
35
36 $this->addReference('baz-tag', $tag3);
37
fc732227
JB
38 $manager->flush();
39 }
40
41 /**
42 * {@inheritdoc}
43 */
44 public function getOrder()
45 {
46 return 25;
47 }
48}