public function create($username, $password, $email, $active, $superadmin)
    {
        $user = $this->userManager->createUser();
        $user->setUsername($username);
        $user->setEmail($email);
        $user->setPlainPassword($password);
        $user->setEnabled((bool) $active);
        $user->setSuperAdmin((bool) $superadmin);
        $this->userManager->updateUser($user);

        $event = new UserEvent($user, $this->getRequest());
        $this->dispatcher->dispatch(Events::USER_CREATED, $event);

        return $user;
    }
public function create($username, $password, $email, $active, $superadmin)
    {
        $user = $this->userManager->createUser();
        $user->setUsername($username);
        $user->setEmail($email);
        $user->setPlainPassword($password);
        $user->setEnabled((bool) $active);
        $user->setSuperAdmin((bool) $superadmin);
        $this->userManager->updateUser($user);

        $event = new UserEvent($user, $this->getRequest());
        $this->dispatcher->dispatch(Events::USER_CREATED, $event);

        return $user;
    }
public function create ( $ username , $ password , $ email , $ active , $ superadmin ) { $ user = $ this -> userManager -> createUser ( ) ; $ user -> setUsername ( $ username ) ; $ user -> setEmail ( $ email ) ; $ user -> setPlainPassword ( $ password ) ; $ user -> setEnabled ( ( bool ) $ active ) ; $ user -> setSuperAdmin ( ( bool ) $ superadmin ) ; $ this -> userManager -> updateUser ( $ user ) ; $ event = new UserEvent ( $ user , $ this -> getRequest ( ) ) ; $ this -> dispatcher -> dispatch ( Events :: USER_CREATED , $ event ) ; return $ user ; }
Creates a user and returns it.

@param string $username
@param string $password
@param string $email
@param bool   $active
@param bool   $superadmin

@return UserInterface
Creates a user and returns it .