]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php
Retrieve created date from Pocket
[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
10 class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
11 {
12 /**
13 * {@inheritdoc}
14 */
15 public function load(ObjectManager $manager)
16 {
17 $entry1 = new Entry($this->getReference('admin-user'));
18 $entry1->setUrl('http://0.0.0.0/entry1');
19 $entry1->setReadingTime(11);
20 $entry1->setDomainName('domain.io');
21 $entry1->setMimetype('text/html');
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/entry2');
32 $entry2->setReadingTime(1);
33 $entry2->setDomainName('domain.io');
34 $entry2->setMimetype('text/html');
35 $entry2->setTitle('test title entry2');
36 $entry2->setContent('This is my content /o/');
37 $entry2->setLanguage('fr');
38
39 $manager->persist($entry2);
40
41 $this->addReference('entry2', $entry2);
42
43 $entry3 = new Entry($this->getReference('bob-user'));
44 $entry3->setUrl('http://0.0.0.0/entry3');
45 $entry3->setReadingTime(1);
46 $entry3->setDomainName('domain.io');
47 $entry3->setMimetype('text/html');
48 $entry3->setTitle('test title entry3');
49 $entry3->setContent('This is my content /o/');
50 $entry3->setLanguage('en');
51
52 $entry3->addTag($this->getReference('foo-tag'));
53 $entry3->addTag($this->getReference('bar-tag'));
54
55 $manager->persist($entry3);
56
57 $this->addReference('entry3', $entry3);
58
59 $entry4 = new Entry($this->getReference('admin-user'));
60 $entry4->setUrl('http://0.0.0.0/entry4');
61 $entry4->setReadingTime(12);
62 $entry4->setDomainName('domain.io');
63 $entry4->setMimetype('text/html');
64 $entry4->setTitle('test title entry4');
65 $entry4->setContent('This is my content /o/');
66 $entry4->setLanguage('en');
67
68 $entry4->addTag($this->getReference('foo-tag'));
69 $entry4->addTag($this->getReference('bar-tag'));
70
71 $manager->persist($entry4);
72
73 $this->addReference('entry4', $entry4);
74
75 $entry5 = new Entry($this->getReference('admin-user'));
76 $entry5->setUrl('http://0.0.0.0/entry5');
77 $entry5->setReadingTime(12);
78 $entry5->setDomainName('domain.io');
79 $entry5->setMimetype('text/html');
80 $entry5->setTitle('test title entry5');
81 $entry5->setContent('This is my content /o/');
82 $entry5->setStarred(true);
83 $entry5->setLanguage('fr');
84 $entry5->setPreviewPicture('http://0.0.0.0/image.jpg');
85
86 $manager->persist($entry5);
87
88 $this->addReference('entry5', $entry5);
89
90 $entry6 = new Entry($this->getReference('admin-user'));
91 $entry6->setUrl('http://0.0.0.0/entry6');
92 $entry6->setReadingTime(12);
93 $entry6->setDomainName('domain.io');
94 $entry6->setMimetype('text/html');
95 $entry6->setTitle('test title entry6');
96 $entry6->setContent('This is my content /o/');
97 $entry6->setArchived(true);
98 $entry6->setLanguage('de');
99
100 $manager->persist($entry6);
101
102 $this->addReference('entry6', $entry6);
103
104 $manager->flush();
105 }
106
107 /**
108 * {@inheritdoc}
109 */
110 public function getOrder()
111 {
112 return 30;
113 }
114 }