3 namespace Wallabag\UserBundle\DataFixtures\ORM
;
5 use Doctrine\Common\DataFixtures\AbstractFixture
;
6 use Doctrine\Common\DataFixtures\OrderedFixtureInterface
;
7 use Doctrine\Common\Persistence\ObjectManager
;
8 use Wallabag\UserBundle\Entity\User
;
10 class LoadUserData
extends AbstractFixture
implements OrderedFixtureInterface
15 public function load(ObjectManager
$manager)
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');
25 $manager->persist($userAdmin);
27 $this->addReference('admin-user', $userAdmin);
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);
36 $manager->persist($bobUser);
38 $this->addReference('bob-user', $bobUser);
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);
47 $manager->persist($emptyUser);
49 $this->addReference('empty-user', $emptyUser);
57 public function getOrder()