public function regenerateInvitationToken()
    {
        if (null === $this->invitationToken()) {
            throw new UserInvitationAlreadyAcceptedException();
        }
        $this->invitationToken = new UserToken();

        $this->publish(
            new UserInvitationTokenRegenerated(
                $this->id,
                $this->email,
                $this->invitationToken
            )
        );
    }
public function regenerateInvitationToken()
    {
        if (null === $this->invitationToken()) {
            throw new UserInvitationAlreadyAcceptedException();
        }
        $this->invitationToken = new UserToken();

        $this->publish(
            new UserInvitationTokenRegenerated(
                $this->id,
                $this->email,
                $this->invitationToken
            )
        );
    }
public function regenerateInvitationToken ( ) { if ( null === $ this -> invitationToken ( ) ) { throw new UserInvitationAlreadyAcceptedException ( ) ; } $ this -> invitationToken = new UserToken ( ) ; $ this -> publish ( new UserInvitationTokenRegenerated ( $ this -> id , $ this -> email , $ this -> invitationToken ) ) ; }
Updates the invitation token in case a user has
been already invited and has lost the token.

@throws UserInvitationAlreadyAcceptedException in case user has already accepted the invitation
Updates the invitation token in case a user has been already invited and has lost the token .