]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php
Fix srcset attribute on images downloaded
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / DataFixtures / ORM / LoadConfigData.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\Config;
9
10 class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
11 {
12 /**
13 * {@inheritdoc}
14 */
15 public function load(ObjectManager $manager)
16 {
17 $adminConfig = new Config($this->getReference('admin-user'));
18
19 $adminConfig->setTheme('material');
20 $adminConfig->setItemsPerPage(30);
21 $adminConfig->setReadingSpeed(1);
22 $adminConfig->setLanguage('en');
23 $adminConfig->setPocketConsumerKey('xxxxx');
24 $adminConfig->setActionMarkAsRead(0);
25 $adminConfig->setListMode(0);
26
27 $manager->persist($adminConfig);
28
29 $this->addReference('admin-config', $adminConfig);
30
31 $bobConfig = new Config($this->getReference('bob-user'));
32 $bobConfig->setTheme('default');
33 $bobConfig->setItemsPerPage(10);
34 $bobConfig->setReadingSpeed(1);
35 $bobConfig->setLanguage('fr');
36 $bobConfig->setPocketConsumerKey(null);
37 $bobConfig->setActionMarkAsRead(1);
38 $bobConfig->setListMode(1);
39
40 $manager->persist($bobConfig);
41
42 $this->addReference('bob-config', $bobConfig);
43
44 $emptyConfig = new Config($this->getReference('empty-user'));
45 $emptyConfig->setTheme('material');
46 $emptyConfig->setItemsPerPage(10);
47 $emptyConfig->setReadingSpeed(1);
48 $emptyConfig->setLanguage('en');
49 $emptyConfig->setPocketConsumerKey(null);
50 $emptyConfig->setActionMarkAsRead(0);
51 $emptyConfig->setListMode(0);
52
53 $manager->persist($emptyConfig);
54
55 $this->addReference('empty-config', $emptyConfig);
56
57 $manager->flush();
58 }
59
60 /**
61 * {@inheritdoc}
62 */
63 public function getOrder()
64 {
65 return 20;
66 }
67 }