]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php
CS
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / DataFixtures / TagFixtures.php
CommitLineData
fc732227
JB
1<?php
2
db9b6d8d 3namespace Wallabag\CoreBundle\DataFixtures;
fc732227 4
db9b6d8d 5use Doctrine\Bundle\FixturesBundle\Fixture;
fc732227
JB
6use Doctrine\Common\Persistence\ObjectManager;
7use Wallabag\CoreBundle\Entity\Tag;
8
db9b6d8d 9class TagFixtures extends Fixture
fc732227
JB
10{
11 /**
12 * {@inheritdoc}
13 */
14 public function load(ObjectManager $manager)
15 {
16 $tag1 = new Tag();
c8de7ab9 17 $tag1->setLabel('foo bar');
fc732227
JB
18
19 $manager->persist($tag1);
20
7c04b739 21 $this->addReference('foo-bar-tag', $tag1);
fc732227
JB
22
23 $tag2 = new Tag();
24 $tag2->setLabel('bar');
25
26 $manager->persist($tag2);
27
28 $this->addReference('bar-tag', $tag2);
29
267e8d63
NL
30 $tag3 = new Tag();
31 $tag3->setLabel('baz');
32
33 $manager->persist($tag3);
34
35 $this->addReference('baz-tag', $tag3);
36
7c04b739
JB
37 $tag4 = new Tag();
38 $tag4->setLabel('foo');
39
40 $manager->persist($tag4);
41
42 $this->addReference('foo-tag', $tag4);
43
fc732227
JB
44 $manager->flush();
45 }
fc732227 46}