public function demote($username)
    {
        $user = $this->findUserByUsernameOrThrowException($username);
        $user->setSuperAdmin(false);
        $this->userManager->updateUser($user);

        $event = new UserEvent($user, $this->getRequest());
        $this->dispatcher->dispatch(Events::USER_DEMOTED, $event);
    }
public function demote($username)
    {
        $user = $this->findUserByUsernameOrThrowException($username);
        $user->setSuperAdmin(false);
        $this->userManager->updateUser($user);

        $event = new UserEvent($user, $this->getRequest());
        $this->dispatcher->dispatch(Events::USER_DEMOTED, $event);
    }
public function demote ( $ username ) { $ user = $ this -> findUserByUsernameOrThrowException ( $ username ) ; $ user -> setSuperAdmin ( false ) ; $ this -> userManager -> updateUser ( $ user ) ; $ event = new UserEvent ( $ user , $ this -> getRequest ( ) ) ; $ this -> dispatcher -> dispatch ( Events :: USER_DEMOTED , $ event ) ; }
Demotes the given user.

@param string $username
Demotes the given user .