diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-02-23 20:56:09 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-02-23 20:56:09 +0100 |
commit | 0e7971d8354b0923d2e8f38690b9fe46e695dd93 (patch) | |
tree | 7026acde83f5d38a9ad94d92f926d880aa233dbe /src/Wallabag/CoreBundle/DataFixtures/ORM | |
parent | 2f6a596760c62efd9e43602f787fa44400d522b3 (diff) | |
parent | c641baad0ec52198d77f2018c7bf8acdfe5957ce (diff) | |
download | wallabag-0e7971d8354b0923d2e8f38690b9fe46e695dd93.tar.gz wallabag-0e7971d8354b0923d2e8f38690b9fe46e695dd93.tar.zst wallabag-0e7971d8354b0923d2e8f38690b9fe46e695dd93.zip |
Merge pull request #1095 from wallabag/v2-config
V2 config
Diffstat (limited to 'src/Wallabag/CoreBundle/DataFixtures/ORM')
3 files changed, 48 insertions, 3 deletions
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php new file mode 100644 index 00000000..900e151d --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php | |||
@@ -0,0 +1,45 @@ | |||
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 | $adminConfig->setTheme('baggy'); | ||
19 | $adminConfig->setItemsPerPage(30); | ||
20 | $adminConfig->setLanguage('en_US'); | ||
21 | |||
22 | $manager->persist($adminConfig); | ||
23 | |||
24 | $this->addReference('admin-config', $adminConfig); | ||
25 | |||
26 | $bobConfig = new Config($this->getReference('bob-user')); | ||
27 | $bobConfig->setTheme('default'); | ||
28 | $bobConfig->setItemsPerPage(10); | ||
29 | $bobConfig->setLanguage('fr_FR'); | ||
30 | |||
31 | $manager->persist($bobConfig); | ||
32 | |||
33 | $this->addReference('bob-config', $bobConfig); | ||
34 | |||
35 | $manager->flush(); | ||
36 | } | ||
37 | |||
38 | /** | ||
39 | * {@inheritDoc} | ||
40 | */ | ||
41 | public function getOrder() | ||
42 | { | ||
43 | return 20; | ||
44 | } | ||
45 | } | ||
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php index 520b44b8..3be323ed 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php | |||
@@ -49,6 +49,6 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface | |||
49 | */ | 49 | */ |
50 | public function getOrder() | 50 | public function getOrder() |
51 | { | 51 | { |
52 | return 20; | 52 | return 30; |
53 | } | 53 | } |
54 | } | 54 | } |
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php index e4751f20..d99412f4 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php | |||
@@ -18,7 +18,7 @@ class LoadUserData extends AbstractFixture implements OrderedFixtureInterface | |||
18 | $userAdmin->setName('Big boss'); | 18 | $userAdmin->setName('Big boss'); |
19 | $userAdmin->setEmail('bigboss@wallabag.org'); | 19 | $userAdmin->setEmail('bigboss@wallabag.org'); |
20 | $userAdmin->setUsername('admin'); | 20 | $userAdmin->setUsername('admin'); |
21 | $userAdmin->setPassword('test'); | 21 | $userAdmin->setPassword('mypassword'); |
22 | 22 | ||
23 | $manager->persist($userAdmin); | 23 | $manager->persist($userAdmin); |
24 | 24 | ||
@@ -28,7 +28,7 @@ class LoadUserData extends AbstractFixture implements OrderedFixtureInterface | |||
28 | $bobUser->setName('Bobby'); | 28 | $bobUser->setName('Bobby'); |
29 | $bobUser->setEmail('bobby@wallabag.org'); | 29 | $bobUser->setEmail('bobby@wallabag.org'); |
30 | $bobUser->setUsername('bob'); | 30 | $bobUser->setUsername('bob'); |
31 | $bobUser->setPassword('test'); | 31 | $bobUser->setPassword('mypassword'); |
32 | 32 | ||
33 | $manager->persist($bobUser); | 33 | $manager->persist($bobUser); |
34 | 34 | ||