aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-23 20:56:09 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-23 20:56:09 +0100
commit0e7971d8354b0923d2e8f38690b9fe46e695dd93 (patch)
tree7026acde83f5d38a9ad94d92f926d880aa233dbe /src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php
parent2f6a596760c62efd9e43602f787fa44400d522b3 (diff)
parentc641baad0ec52198d77f2018c7bf8acdfe5957ce (diff)
downloadwallabag-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/LoadConfigData.php')
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php45
1 files changed, 45 insertions, 0 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
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 /**
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}