Beispiel #1
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     $admin = new User();
     $admin->setFullName('Admin ADMIN');
     $admin->setLogin('admin');
     $admin->setMail('*****@*****.**');
     $admin->setIsAdmin(true);
     $admin->setAvatar('admin.png');
     $admin->setBirthday(new \DateTime());
     $admin->setLastVisitHome(new \DateTime());
     $admin->setReadOnlyExpirationDate(new \DateTime());
     $user = new User();
     $user->setFullName('User USER');
     $user->setLogin('user');
     $user->setMail('*****@*****.**');
     $user->setIsAdmin(false);
     $user->setAvatar('user.png');
     $user->setBirthday(new \DateTime());
     $user->setLastVisitHome(new \DateTime());
     $user->setReadOnlyExpirationDate(new \DateTime());
     $orga = new Organization();
     $orga->setName('Orga ORGA');
     $orga->setLogin('orga');
     $orga->setContactMail('*****@*****.**');
     $manager->persist($admin);
     $manager->persist($user);
     $manager->persist($orga);
     $membership = new Member();
     $membership->setOrganization($orga);
     $membership->setUser($user);
     $membership->addPermission('daymail');
     $manager->persist($membership);
     $manager->flush();
     $this->addReference('user_admin', $admin);
     $this->addReference('user_user', $user);
     $this->addReference('user_orga', $orga);
     $this->addReference('user_membership', $orga);
 }