class Invitation extends UrlModel

An invitation sent to a player asking them to join a team

Constants

TABLE

The name of the database table used for queries

Methods

static Invitation
sendInvite(int $to, int $teamid, int|null $from = null, string $message = '', string|TimeDate|null $expiration = null)

Send an invitation to join a team

getInvitedPlayer()

Get the player receiving the invite

getSentBy()

Get the sender of the invite

getTeam()

Get the team a player was invited to

getExpiration()

Get the time when the invitation will expire

updateExpiration()

Mark the invitation as having expired

string
getText()

Get the optional message sent to a player to join a team

static int
hasOpenInvitation(int $player, int $team)

Find whether there are unexpired invitations for a player and a team

Details

at line line 72
static Invitation sendInvite(int $to, int $teamid, int|null $from = null, string $message = '', string|TimeDate|null $expiration = null)

Send an invitation to join a team

Parameters

int $to The ID of the player who will receive the invitation
int $teamid The team ID to which a player has been invited to
int|null $from The ID of the player who sent it
string $message (Optional) The message that will be displayed to the person receiving the invitation
string|TimeDate|null $expiration The expiration time of the invitation (defaults to 1 week from now)

Return Value

Invitation The object of the invitation just sent

at line line 96
Player getInvitedPlayer()

Get the player receiving the invite

Return Value

Player

at line line 106
Player getSentBy()

Get the sender of the invite

Return Value

Player

at line line 116
Team getTeam()

Get the team a player was invited to

Return Value

Team

at line line 126
TimeDate getExpiration()

Get the time when the invitation will expire

Return Value

TimeDate

at line line 136
Invitation updateExpiration()

Mark the invitation as having expired

Return Value

Invitation

at line line 146
string getText()

Get the optional message sent to a player to join a team

Return Value

string

at line line 158
static int hasOpenInvitation(int $player, int $team)

Find whether there are unexpired invitations for a player and a team

Parameters

int $player
int $team

Return Value

int