]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php
Move readingTime & domainName in ContentProxy
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / DataFixtures / ORM / LoadEntryData.php
1 <?php
2
3 namespace Wallabag\CoreBundle\DataFixtures\ORM;
4
5 use Doctrine\Common\DataFixtures\AbstractFixture;
6 use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
7 use Doctrine\Common\Persistence\ObjectManager;
8 use Wallabag\CoreBundle\Entity\Entry;
9 use Wallabag\CoreBundle\Entity\Tag;
10
11 class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
12 {
13 /**
14 * {@inheritdoc}
15 */
16 public function load(ObjectManager $manager)
17 {
18 $entry1 = new Entry($this->getReference('admin-user'));
19 $entry1->setUrl('http://0.0.0.0');
20 $entry1->setReadingTime(11);
21 $entry1->setDomainName('domain.io');
22 $entry1->setTitle('test title entry1');
23 $entry1->setContent('This is my content /o/');
24 $entry1->setLanguage('en');
25
26 $manager->persist($entry1);
27
28 $this->addReference('entry1', $entry1);
29
30 $entry2 = new Entry($this->getReference('admin-user'));
31 $entry2->setUrl('http://0.0.0.0');
32 $entry2->setReadingTime(1);
33 $entry2->setDomainName('domain.io');
34 $entry2->setTitle('test title entry2');
35 $entry2->setContent('This is my content /o/');
36 $entry2->setLanguage('fr');
37
38 $manager->persist($entry2);
39
40 $this->addReference('entry2', $entry2);
41
42 $entry3 = new Entry($this->getReference('bob-user'));
43 $entry3->setUrl('http://0.0.0.0');
44 $entry3->setReadingTime(1);
45 $entry3->setDomainName('domain.io');
46 $entry3->setTitle('test title entry3');
47 $entry3->setContent('This is my content /o/');
48 $entry3->setLanguage('en');
49
50 $tag1 = new Tag($this->getReference('bob-user'));
51 $tag1->setLabel('foo');
52 $tag2 = new Tag($this->getReference('bob-user'));
53 $tag2->setLabel('bar');
54
55 $entry3->addTag($tag1);
56 $entry3->addTag($tag2);
57
58 $manager->persist($entry3);
59
60 $this->addReference('entry3', $entry3);
61
62 $entry4 = new Entry($this->getReference('admin-user'));
63 $entry4->setUrl('http://0.0.0.0');
64 $entry4->setReadingTime(12);
65 $entry4->setDomainName('domain.io');
66 $entry4->setTitle('test title entry4');
67 $entry4->setContent('This is my content /o/');
68 $entry4->setLanguage('en');
69
70 $tag1 = new Tag($this->getReference('admin-user'));
71 $tag1->setLabel('foo');
72 $tag2 = new Tag($this->getReference('admin-user'));
73 $tag2->setLabel('bar');
74
75 $entry4->addTag($tag1);
76 $entry4->addTag($tag2);
77
78 $manager->persist($entry4);
79
80 $this->addReference('entry4', $entry4);
81
82 $entry5 = new Entry($this->getReference('admin-user'));
83 $entry5->setUrl('http://0.0.0.0');
84 $entry5->setReadingTime(12);
85 $entry5->setDomainName('domain.io');
86 $entry5->setTitle('test title entry5');
87 $entry5->setContent('This is my content /o/');
88 $entry5->setStarred(true);
89 $entry5->setLanguage('fr');
90
91 $manager->persist($entry5);
92
93 $this->addReference('entry5', $entry5);
94
95 $entry6 = new Entry($this->getReference('admin-user'));
96 $entry6->setUrl('http://0.0.0.0');
97 $entry6->setReadingTime(12);
98 $entry6->setDomainName('domain.io');
99 $entry6->setTitle('test title entry6');
100 $entry6->setContent('This is my content /o/');
101 $entry6->setArchived(true);
102 $entry6->setLanguage('de');
103
104 $manager->persist($entry6);
105
106 $this->addReference('entry6', $entry6);
107
108 $manager->flush();
109 }
110
111 /**
112 * {@inheritdoc}
113 */
114 public function getOrder()
115 {
116 return 30;
117 }
118 }