3 namespace Wallabag\CoreBundle\DataFixtures\ORM
;
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
;
12 class LoadSettingData
extends AbstractFixture
implements OrderedFixtureInterface
, ContainerAwareInterface
15 * @var ContainerInterface
19 public function setContainer(ContainerInterface
$container = null)
21 $this->container
= $container;
27 public function load(ObjectManager
$manager)
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);
43 public function getOrder()