]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php
fixtures: refactor EntryData, TagData, add a new tag
[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 {
bafb9744
KD
17 $tags = [
18 'foo-bar-tag' => 'foo bar', //tag used for EntryControllerTest
19 'bar-tag' => 'bar',
20 'baz-tag' => 'baz', // tag used for ExportControllerTest
21 'foo-tag' => 'foo',
22 'bob-tag' => 'bob', // tag used for TagRestControllerTest
23 ];
24
25 foreach ($tags as $reference => $label) {
26 $tag = new Tag();
27 $tag->setLabel($label);
28
29 $manager->persist($tag);
30
31 $this->addReference($reference, $tag);
32 }
7c04b739 33
fc732227
JB
34 $manager->flush();
35 }
36
37 /**
38 * {@inheritdoc}
39 */
40 public function getOrder()
41 {
42 return 25;
43 }
44}