3 namespace Wallabag\CoreBundle\DataFixtures\ORM
;
5 use Doctrine\Common\DataFixtures\AbstractFixture
;
6 use Doctrine\Common\DataFixtures\OrderedFixtureInterface
;
7 use Doctrine\Common\Persistence\ObjectManager
;
8 use Wallabag\CoreBundle\Entity\Entry
;
10 class LoadEntryData
extends AbstractFixture
implements OrderedFixtureInterface
15 public function load(ObjectManager
$manager)
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');
26 $manager->persist($entry1);
28 $this->addReference('entry1', $entry1);
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');
39 $manager->persist($entry2);
41 $this->addReference('entry2', $entry2);
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');
52 $entry3->addTag($this->getReference('foo-tag'));
53 $entry3->addTag($this->getReference('bar-tag'));
55 $manager->persist($entry3);
57 $this->addReference('entry3', $entry3);
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');
68 $entry4->addTag($this->getReference('foo-tag'));
69 $entry4->addTag($this->getReference('bar-tag'));
71 $manager->persist($entry4);
73 $this->addReference('entry4', $entry4);
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');
86 $manager->persist($entry5);
88 $this->addReference('entry5', $entry5);
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');
100 $manager->persist($entry6);
102 $this->addReference('entry6', $entry6);
110 public function getOrder()