SHARE
TWEET

Untitled

a guest Jun 20th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         $usuario = new Usuario();
  2.         $plainPassword = 'olakease';
  3.         $encoder       = $this->getContainer()->get('security.password_encoder');
  4.         $encoded       = $encoder->encodePassword($usuario, $plainPassword);
  5.         $usuario->setPassword($encoded);
  6.  
  7.         $usuario->setNombre('Hernán Antonio');
  8.         $usuario->setApellidoPaterno('Bozán');
  9.         $usuario->setApellidoMaterno('Araya');
  10.         $usuario->setRut('171684218');
  11.         $usuario->setGenero('Masculino');
  12.         $usuario->setCorreo('hernan.bozan@gmail.com');
  13.         $usuario->setFechaNacimiento(new  DateTime('now'));
  14.         $usuario->setRol($this->manager->getRepository(Rol::class)->findOneByNombreSistema('ROLE_SUPER_ADMIN'));
  15.  
  16.         $this->manager->persist($usuario);
  17.         $this->manager->flush();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top