diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2018-11-26 20:00:01 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2018-11-28 22:04:54 +0100 |
commit | db9b6d8d0d9f943fe321ea690701662dac828e94 (patch) | |
tree | 165dae22924a69a087f01434d131b5e389b10535 /src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php | |
parent | 9394e8098a92c849d15c43dcd0c338887bff68ce (diff) | |
download | wallabag-db9b6d8d0d9f943fe321ea690701662dac828e94.tar.gz wallabag-db9b6d8d0d9f943fe321ea690701662dac828e94.tar.zst wallabag-db9b6d8d0d9f943fe321ea690701662dac828e94.zip |
Update fixtures
Diffstat (limited to 'src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php')
-rw-r--r-- | src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php deleted file mode 100644 index 3fe88e7f..00000000 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\DataFixtures\ORM; | ||
4 | |||
5 | use Craue\ConfigBundle\Entity\Setting; | ||
6 | use Doctrine\Common\DataFixtures\AbstractFixture; | ||
7 | use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | ||
8 | use Doctrine\Common\Persistence\ObjectManager; | ||
9 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; | ||
10 | use Symfony\Component\DependencyInjection\ContainerInterface; | ||
11 | |||
12 | class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface, ContainerAwareInterface | ||
13 | { | ||
14 | /** | ||
15 | * @var ContainerInterface | ||
16 | */ | ||
17 | private $container; | ||
18 | |||
19 | public function setContainer(ContainerInterface $container = null) | ||
20 | { | ||
21 | $this->container = $container; | ||
22 | } | ||
23 | |||
24 | /** | ||
25 | * {@inheritdoc} | ||
26 | */ | ||
27 | public function load(ObjectManager $manager) | ||
28 | { | ||
29 | foreach ($this->container->getParameter('wallabag_core.default_internal_settings') as $setting) { | ||
30 | $newSetting = new Setting(); | ||
31 | $newSetting->setName($setting['name']); | ||
32 | $newSetting->setValue($setting['value']); | ||
33 | $newSetting->setSection($setting['section']); | ||
34 | $manager->persist($newSetting); | ||
35 | } | ||
36 | |||
37 | $manager->flush(); | ||
38 | } | ||
39 | |||
40 | /** | ||
41 | * {@inheritdoc} | ||
42 | */ | ||
43 | public function getOrder() | ||
44 | { | ||
45 | return 29; | ||
46 | } | ||
47 | } | ||