]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php
Update fixtures
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / DataFixtures / TagFixtures.php
CommitLineData
fc732227
JB
1<?php
2
db9b6d8d 3namespace Wallabag\CoreBundle\DataFixtures;
fc732227 4
db9b6d8d
JB
5use Doctrine\Bundle\FixturesBundle\Fixture;
6use Doctrine\Common\DataFixtures\DependentFixtureInterface;
fc732227
JB
7use Doctrine\Common\Persistence\ObjectManager;
8use Wallabag\CoreBundle\Entity\Tag;
9
db9b6d8d 10class TagFixtures extends Fixture
fc732227
JB
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
7c04b739 22 $this->addReference('foo-bar-tag', $tag1);
fc732227
JB
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
7c04b739
JB
38 $tag4 = new Tag();
39 $tag4->setLabel('foo');
40
41 $manager->persist($tag4);
42
43 $this->addReference('foo-tag', $tag4);
44
fc732227
JB
45 $manager->flush();
46 }
fc732227 47}