]>
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'); |
0bf99bb1 J |
23 | |
24 | $manager->persist($adminConfig); | |
25 | ||
26 | $this->addReference('admin-config', $adminConfig); | |
27 | ||
28 | $bobConfig = new Config($this->getReference('bob-user')); | |
29 | $bobConfig->setTheme('default'); | |
30 | $bobConfig->setItemsPerPage(10); | |
889c1cf3 | 31 | $bobConfig->setReadingSpeed(1); |
23ff8d36 | 32 | $bobConfig->setLanguage('fr'); |
0bf99bb1 J |
33 | |
34 | $manager->persist($bobConfig); | |
35 | ||
36 | $this->addReference('bob-config', $bobConfig); | |
37 | ||
5c072d2b NL |
38 | $emptyConfig = new Config($this->getReference('empty-user')); |
39 | $emptyConfig->setTheme('material'); | |
40 | $emptyConfig->setItemsPerPage(10); | |
889c1cf3 | 41 | $emptyConfig->setReadingSpeed(1); |
5c072d2b NL |
42 | $emptyConfig->setLanguage('en'); |
43 | ||
44 | $manager->persist($emptyConfig); | |
45 | ||
46 | $this->addReference('empty-config', $emptyConfig); | |
47 | ||
0bf99bb1 J |
48 | $manager->flush(); |
49 | } | |
50 | ||
51 | /** | |
8ce32af6 | 52 | * {@inheritdoc} |
0bf99bb1 J |
53 | */ |
54 | public function getOrder() | |
55 | { | |
56 | return 20; | |
57 | } | |
58 | } |