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