]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/DataFixtures/ORM/LoadConfigData.php
Document the matches operator in the FAQ
[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'));
4ab58dcf 18 $adminConfig->setTheme('material');
0bf99bb1
J
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 /**
8ce32af6 39 * {@inheritdoc}
0bf99bb1
J
40 */
41 public function getOrder()
42 {
43 return 20;
44 }
45}