]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php
Retrieve created date from Pocket
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / DataFixtures / ORM / LoadConfigData.php
CommitLineData
0bf99bb1
J
1<?php
2
3namespace Wallabag\CoreBundle\DataFixtures\ORM;
4
5use Doctrine\Common\DataFixtures\AbstractFixture;
6use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
7use Doctrine\Common\Persistence\ObjectManager;
8use Wallabag\CoreBundle\Entity\Config;
9
10class 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}