]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php
Add ability to manually define the reading speed
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / DataFixtures / ConfigFixtures.php
CommitLineData
0bf99bb1
J
1<?php
2
db9b6d8d 3namespace Wallabag\CoreBundle\DataFixtures;
0bf99bb1 4
db9b6d8d
JB
5use Doctrine\Bundle\FixturesBundle\Fixture;
6use Doctrine\Common\DataFixtures\DependentFixtureInterface;
0bf99bb1
J
7use Doctrine\Common\Persistence\ObjectManager;
8use Wallabag\CoreBundle\Entity\Config;
db9b6d8d 9use Wallabag\UserBundle\DataFixtures\UserFixtures;
0bf99bb1 10
db9b6d8d 11class ConfigFixtures extends Fixture implements DependentFixtureInterface
0bf99bb1
J
12{
13 /**
8ce32af6 14 * {@inheritdoc}
0bf99bb1
J
15 */
16 public function load(ObjectManager $manager)
17 {
18 $adminConfig = new Config($this->getReference('admin-user'));
958671a7 19
4ab58dcf 20 $adminConfig->setTheme('material');
0bf99bb1 21 $adminConfig->setItemsPerPage(30);
41022cb2 22 $adminConfig->setReadingSpeed(200);
23ff8d36 23 $adminConfig->setLanguage('en');
ebe0787e 24 $adminConfig->setPocketConsumerKey('xxxxx');
a42f38d9 25 $adminConfig->setActionMarkAsRead(0);
24879db1 26 $adminConfig->setListMode(0);
0bf99bb1
J
27
28 $manager->persist($adminConfig);
29
30 $this->addReference('admin-config', $adminConfig);
31
32 $bobConfig = new Config($this->getReference('bob-user'));
33 $bobConfig->setTheme('default');
34 $bobConfig->setItemsPerPage(10);
41022cb2 35 $bobConfig->setReadingSpeed(200);
23ff8d36 36 $bobConfig->setLanguage('fr');
ebe0787e 37 $bobConfig->setPocketConsumerKey(null);
a42f38d9 38 $bobConfig->setActionMarkAsRead(1);
24879db1 39 $bobConfig->setListMode(1);
0bf99bb1
J
40
41 $manager->persist($bobConfig);
42
43 $this->addReference('bob-config', $bobConfig);
44
5c072d2b
NL
45 $emptyConfig = new Config($this->getReference('empty-user'));
46 $emptyConfig->setTheme('material');
47 $emptyConfig->setItemsPerPage(10);
41022cb2 48 $emptyConfig->setReadingSpeed(200);
5c072d2b 49 $emptyConfig->setLanguage('en');
ebe0787e 50 $emptyConfig->setPocketConsumerKey(null);
a42f38d9 51 $emptyConfig->setActionMarkAsRead(0);
24879db1 52 $emptyConfig->setListMode(0);
5c072d2b
NL
53
54 $manager->persist($emptyConfig);
55
56 $this->addReference('empty-config', $emptyConfig);
57
0bf99bb1
J
58 $manager->flush();
59 }
60
61 /**
8ce32af6 62 * {@inheritdoc}
0bf99bb1 63 */
db9b6d8d 64 public function getDependencies()
0bf99bb1 65 {
db9b6d8d
JB
66 return [
67 UserFixtures::class,
68 ];
0bf99bb1
J
69 }
70}