diff options
author | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2015-10-06 09:19:06 +0200 |
---|---|---|
committer | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2015-10-06 09:19:06 +0200 |
commit | 16dabc326311f084d671be188c7941bbb3c341c9 (patch) | |
tree | 3210a7688ea2bfa1bff5fd0422b52adf570edcdc /src/Wallabag/UserBundle/DataFixtures | |
parent | fdef5f460524215d806e244e5546865f4b8e01df (diff) | |
parent | 8263e71192989dc0fd28a41ac22f9c5b32eb11c4 (diff) | |
download | wallabag-16dabc326311f084d671be188c7941bbb3c341c9.tar.gz wallabag-16dabc326311f084d671be188c7941bbb3c341c9.tar.zst wallabag-16dabc326311f084d671be188c7941bbb3c341c9.zip |
Merge pull request #1436 from wallabag/v2-register
Public registration & oAuth2 \o/
Diffstat (limited to 'src/Wallabag/UserBundle/DataFixtures')
-rw-r--r-- | src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php b/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php new file mode 100644 index 00000000..d48855da --- /dev/null +++ b/src/Wallabag/UserBundle/DataFixtures/ORM/LoadUserData.php | |||
@@ -0,0 +1,50 @@ | |||
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 | $manager->flush(); | ||
41 | } | ||
42 | |||
43 | /** | ||
44 | * {@inheritdoc} | ||
45 | */ | ||
46 | public function getOrder() | ||
47 | { | ||
48 | return 10; | ||
49 | } | ||
50 | } | ||