]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php
add translations/wallabag_user.de.yml (fixes #2673)
[github/wallabag/wallabag.git] / src / Wallabag / UserBundle / DataFixtures / ORM / LoadUserData.php
1 <?php
2
3 namespace Wallabag\UserBundle\DataFixtures\ORM;
4
5 use Doctrine\Common\DataFixtures\AbstractFixture;
6 use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
7 use Doctrine\Common\Persistence\ObjectManager;
8 use Wallabag\UserBundle\Entity\User;
9
10 class LoadUserData extends AbstractFixture implements OrderedFixtureInterface
11 {
12 /**
13 * {@inheritdoc}
14 */
15 public function load(ObjectManager $manager)
16 {
17 $userAdmin = new User();
18 $userAdmin->setName('Big boss');
19 $userAdmin->setEmail('bigboss@wallabag.org');
20 $userAdmin->setUsername('admin');
21 $userAdmin->setPlainPassword('mypassword');
22 $userAdmin->setEnabled(true);
23 $userAdmin->addRole('ROLE_SUPER_ADMIN');
24
25 $manager->persist($userAdmin);
26
27 $this->addReference('admin-user', $userAdmin);
28
29 $bobUser = new User();
30 $bobUser->setName('Bobby');
31 $bobUser->setEmail('bobby@wallabag.org');
32 $bobUser->setUsername('bob');
33 $bobUser->setPlainPassword('mypassword');
34 $bobUser->setEnabled(true);
35
36 $manager->persist($bobUser);
37
38 $this->addReference('bob-user', $bobUser);
39
40 $emptyUser = new User();
41 $emptyUser->setName('Empty');
42 $emptyUser->setEmail('empty@wallabag.org');
43 $emptyUser->setUsername('empty');
44 $emptyUser->setPlainPassword('mypassword');
45 $emptyUser->setEnabled(true);
46
47 $manager->persist($emptyUser);
48
49 $this->addReference('empty-user', $emptyUser);
50
51 $manager->flush();
52 }
53
54 /**
55 * {@inheritdoc}
56 */
57 public function getOrder()
58 {
59 return 10;
60 }
61 }