3 namespace Wallabag\CoreBundle\DataFixtures
;
5 use Doctrine\Bundle\FixturesBundle\Fixture
;
6 use Doctrine\Common\DataFixtures\DependentFixtureInterface
;
7 use Doctrine\Common\Persistence\ObjectManager
;
8 use Wallabag\CoreBundle\Entity\Entry
;
9 use Wallabag\UserBundle\DataFixtures\UserFixtures
;
11 class EntryFixtures
extends Fixture
implements DependentFixtureInterface
16 public function load(ObjectManager
$manager)
18 $entry1 = new Entry($this->getReference('admin-user'));
19 $entry1->setUrl('http://0.0.0.0/entry1');
20 $entry1->setReadingTime(11);
21 $entry1->setDomainName('domain.io');
22 $entry1->setMimetype('text/html');
23 $entry1->setTitle('test title entry1');
24 $entry1->setContent('This is my content /o/');
25 $entry1->setLanguage('en');
27 $entry1->addTag($this->getReference('foo-tag'));
28 $entry1->addTag($this->getReference('baz-tag'));
30 $manager->persist($entry1);
32 $this->addReference('entry1', $entry1);
34 $entry2 = new Entry($this->getReference('admin-user'));
35 $entry2->setUrl('http://0.0.0.0/entry2');
36 $entry2->setReadingTime(1);
37 $entry2->setDomainName('domain.io');
38 $entry2->setMimetype('text/html');
39 $entry2->setTitle('test title entry2');
40 $entry2->setContent('This is my content /o/');
41 $entry2->setOriginUrl('ftp://oneftp.tld');
42 $entry2->setLanguage('fr');
44 $manager->persist($entry2);
46 $this->addReference('entry2', $entry2);
48 $entry3 = new Entry($this->getReference('bob-user'));
49 $entry3->setUrl('http://0.0.0.0/entry3');
50 $entry3->setReadingTime(1);
51 $entry3->setDomainName('domain.io');
52 $entry3->setMimetype('text/html');
53 $entry3->setTitle('test title entry3');
54 $entry3->setContent('This is my content /o/');
55 $entry3->setLanguage('en');
57 $entry3->addTag($this->getReference('foo-tag'));
58 $entry3->addTag($this->getReference('bar-tag'));
60 $manager->persist($entry3);
62 $this->addReference('entry3', $entry3);
64 $entry4 = new Entry($this->getReference('admin-user'));
65 $entry4->setUrl('http://0.0.0.0/entry4');
66 $entry4->setReadingTime(12);
67 $entry4->setDomainName('domain.io');
68 $entry4->setMimetype('text/html');
69 $entry4->setTitle('test title entry4');
70 $entry4->setContent('This is my content /o/');
71 $entry4->setLanguage('en');
73 $entry4->addTag($this->getReference('foo-tag'));
74 $entry4->addTag($this->getReference('bar-tag'));
76 $manager->persist($entry4);
78 $this->addReference('entry4', $entry4);
80 $entry5 = new Entry($this->getReference('admin-user'));
81 $entry5->setUrl('http://0.0.0.0/entry5');
82 $entry5->setReadingTime(12);
83 $entry5->setDomainName('domain.io');
84 $entry5->setMimetype('text/html');
85 $entry5->setTitle('test title entry5');
86 $entry5->setContent('This is my content /o/');
87 $entry5->setStarred(true);
88 $entry5->setLanguage('fr');
89 $entry5->setPreviewPicture('http://0.0.0.0/image.jpg');
91 $manager->persist($entry5);
93 $this->addReference('entry5', $entry5);
95 $entry6 = new Entry($this->getReference('admin-user'));
96 $entry6->setUrl('http://0.0.0.0/entry6');
97 $entry6->setReadingTime(12);
98 $entry6->setDomainName('domain.io');
99 $entry6->setMimetype('text/html');
100 $entry6->setTitle('test title entry6');
101 $entry6->setContent('This is my content /o/');
102 $entry6->updateArchived(true);
103 $entry6->setLanguage('de');
104 $entry6->addTag($this->getReference('bar-tag'));
106 $manager->persist($entry6);
108 $this->addReference('entry6', $entry6);
116 public function getDependencies()