public function generateToken($userId)
    {
        $user = $this->users->find($userId);

        if (! is_null($user)) {
            $user->generateInvitationToken();
            $user->trackTime('invited_at');
            $user->setStatus(Status::INACTIVE);
        }
    }
public function generateToken($userId)
    {
        $user = $this->users->find($userId);

        if (! is_null($user)) {
            $user->generateInvitationToken();
            $user->trackTime('invited_at');
            $user->setStatus(Status::INACTIVE);
        }
    }
public function generateToken ( $ userId ) { $ user = $ this -> users -> find ( $ userId ) ; if ( ! is_null ( $ user ) ) { $ user -> generateInvitationToken ( ) ; $ user -> trackTime ( 'invited_at' ) ; $ user -> setStatus ( Status :: INACTIVE ) ; } }
Generate an invitation token for a user.

@param int $userId The user's ID.
Generate an invitation token for a user .