/** * Creates a user and returns it. * * @param string $username * @param string $password * @param string $email * @param Boolean $active * @param Boolean $superadmin * @param string $firstName * @param string $lastName * @param integer $phoneNumber * * @return \AppBundle\Entity\Users */ public function create($username, $password, $email, $active, $superadmin, $firstName, $lastName, $phoneNumber) { $user = new Users(); $user->setUsername($username); $user->setEmail($email); $user->setPlainPassword($password); $user->setEnabled((bool) $active); $user->setFirstName($firstName); $user->setLastName($lastName); $user->setPhoneNumber($phoneNumber); $user->setSuperAdmin((bool) $superadmin); $this->userManager->updateUser($user); return $user; }