]>
Commit | Line | Data |
---|---|---|
0bf99bb1 J |
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 | /** | |
8ce32af6 | 13 | * {@inheritdoc} |
0bf99bb1 J |
14 | */ |
15 | public function load(ObjectManager $manager) | |
16 | { | |
17 | $adminConfig = new Config($this->getReference('admin-user')); | |
958671a7 | 18 | |
4ab58dcf | 19 | $adminConfig->setTheme('material'); |
0bf99bb1 | 20 | $adminConfig->setItemsPerPage(30); |
889c1cf3 | 21 | $adminConfig->setReadingSpeed(1); |
23ff8d36 | 22 | $adminConfig->setLanguage('en'); |
ebe0787e | 23 | $adminConfig->setPocketConsumerKey('xxxxx'); |
a42f38d9 | 24 | $adminConfig->setActionMarkAsRead(0); |
24879db1 | 25 | $adminConfig->setListMode(0); |
0bf99bb1 J |
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); | |
889c1cf3 | 34 | $bobConfig->setReadingSpeed(1); |
23ff8d36 | 35 | $bobConfig->setLanguage('fr'); |
ebe0787e | 36 | $bobConfig->setPocketConsumerKey(null); |
a42f38d9 | 37 | $bobConfig->setActionMarkAsRead(1); |
24879db1 | 38 | $bobConfig->setListMode(1); |
0bf99bb1 J |
39 | |
40 | $manager->persist($bobConfig); | |
41 | ||
42 | $this->addReference('bob-config', $bobConfig); | |
43 | ||
5c072d2b NL |
44 | $emptyConfig = new Config($this->getReference('empty-user')); |
45 | $emptyConfig->setTheme('material'); | |
46 | $emptyConfig->setItemsPerPage(10); | |
889c1cf3 | 47 | $emptyConfig->setReadingSpeed(1); |
5c072d2b | 48 | $emptyConfig->setLanguage('en'); |
ebe0787e | 49 | $emptyConfig->setPocketConsumerKey(null); |
a42f38d9 | 50 | $emptyConfig->setActionMarkAsRead(0); |
24879db1 | 51 | $emptyConfig->setListMode(0); |
5c072d2b NL |
52 | |
53 | $manager->persist($emptyConfig); | |
54 | ||
55 | $this->addReference('empty-config', $emptyConfig); | |
56 | ||
0bf99bb1 J |
57 | $manager->flush(); |
58 | } | |
59 | ||
60 | /** | |
8ce32af6 | 61 | * {@inheritdoc} |
0bf99bb1 J |
62 | */ |
63 | public function getOrder() | |
64 | { | |
65 | return 20; | |
66 | } | |
67 | } |