class Model extends CachedModel

A database object (e.g. A player or a team)

Methods

__toString()

Generates a string with the object's type and ID

bool
isDeleted()

Find if the model is in the trash can (or doesn't exist)

bool
isActive()

Find if the model is active (i.e. visible to everyone)

string
getStatus()

Get the models's status

bool
isSameAs(object $model)

Find if two objects represent the same model

static string[]
getActiveStatuses()

Get the possible statuses representing an active model (visible to everyone)

static Model[]
arrayIdToModel(int[] $idArray)

Converts an array of IDs to an array of Models

static int[]
mapToIDs(ModelInterface[] $modelArray)

Converts an array of Models to an array of IDs

static string
getType()

Gets the type of the model

static string
getTypeForHumans()

Gets a human-readable format of the model's type

static string
escape(string $string)

Escape special HTML characters from a string

static Model[]
createFromDatabaseResults(array $results)

Create model objects, given their MySQL entries

Details

at line line 18
__toString()

Generates a string with the object's type and ID

at line line 28
bool isDeleted()

Find if the model is in the trash can (or doesn't exist)

Return Value

bool

at line line 42
bool isActive()

Find if the model is active (i.e. visible to everyone)

Return Value

bool

at line line 52
string getStatus()

Get the models's status

Return Value

string

at line line 67
bool isSameAs(object $model)

Find if two objects represent the same model

Parameters

object $model The model to compare

Return Value

bool

at line line 87
static string[] getActiveStatuses()

Get the possible statuses representing an active model (visible to everyone)

Return Value

string[]

at line line 97
static Model[] arrayIdToModel(int[] $idArray)

Converts an array of IDs to an array of Models

Parameters

int[] $idArray The list of IDs

Return Value

Model[] An array of models

at line line 115
static int[] mapToIDs(ModelInterface[] $modelArray)

Converts an array of Models to an array of IDs

All model type information is lost

Parameters

ModelInterface[] $modelArray The list of models

Return Value

int[] An array of IDs

at line line 151
static string getType()

Gets the type of the model

Return Value

string The type of the model, e.g. "server"

at line line 160
static string getTypeForHumans()

Gets a human-readable format of the model's type

Return Value

string

at line line 205
static string escape(string $string)

Escape special HTML characters from a string

Parameters

string $string

Return Value

string

at line line 216
static Model[] createFromDatabaseResults(array $results)

Create model objects, given their MySQL entries

Parameters

array $results The MySQL rows of the model

Return Value

Model[]