aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/DataFixtures
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-22 21:25:24 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-03-06 20:50:30 +0100
commit6c87418ff013cfd03093c3f01e20518e580d80bb (patch)
tree1d8900eac2a643122151ce4a3123d3c69233f818 /src/Wallabag/CoreBundle/DataFixtures
parent1bd12b62296569764ac329d88e964059dec530be (diff)
downloadwallabag-6c87418ff013cfd03093c3f01e20518e580d80bb.tar.gz
wallabag-6c87418ff013cfd03093c3f01e20518e580d80bb.tar.zst
wallabag-6c87418ff013cfd03093c3f01e20518e580d80bb.zip
fixtures for tag
Diffstat (limited to 'src/Wallabag/CoreBundle/DataFixtures')
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php
index 6b13c2be..4d9846b6 100644
--- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php
@@ -6,6 +6,7 @@ use Doctrine\Common\DataFixtures\AbstractFixture;
6use Doctrine\Common\DataFixtures\OrderedFixtureInterface; 6use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
7use Doctrine\Common\Persistence\ObjectManager; 7use Doctrine\Common\Persistence\ObjectManager;
8use Wallabag\CoreBundle\Entity\Tag; 8use Wallabag\CoreBundle\Entity\Tag;
9use Wallabag\CoreBundle\Entity\TagsEntries;
9 10
10class LoadTagData extends AbstractFixture implements OrderedFixtureInterface 11class LoadTagData extends AbstractFixture implements OrderedFixtureInterface
11{ 12{
@@ -19,16 +20,34 @@ class LoadTagData extends AbstractFixture implements OrderedFixtureInterface
19 20
20 $manager->persist($tag1); 21 $manager->persist($tag1);
21 22
23 $this->addReference('tag1', $tag1);
24
25 $tagsEntries1 = new TagsEntries();
26 $tagsEntries1->setEntryId($this->getReference('entry1'));
27 $manager->persist($tagsEntries1);
28
22 $tag2 = new Tag(); 29 $tag2 = new Tag();
23 $tag2->setLabel('bar'); 30 $tag2->setLabel('bar');
24 31
25 $manager->persist($tag2); 32 $manager->persist($tag2);
26 33
34 $this->addReference('tag2', $tag2);
35
36 $tagsEntries2 = new TagsEntries();
37 $tagsEntries2->setEntryId($this->getReference('entry2'));
38 $manager->persist($tagsEntries2);
39
27 $tag3 = new Tag(); 40 $tag3 = new Tag();
28 $tag3->setLabel('baz'); 41 $tag3->setLabel('baz');
29 42
30 $manager->persist($tag3); 43 $manager->persist($tag3);
31 44
45 $this->addReference('tag3', $tag3);
46
47 $tagsEntries3 = new TagsEntries();
48 $tagsEntries3->setEntryId($this->getReference('entry2'));
49 $manager->persist($tagsEntries3);
50
32 $manager->flush(); 51 $manager->flush();
33 } 52 }
34 53