interface ModelInterface

A base database object interface

Methods

void
delete()

Delete the object

void
wipe()

Permanently delete the object from the database

int
getId()

Get an object's database ID

bool
isValid()

See if an object is valid

bool
isDeleted()

Check if a status of the object is 'deleted'

static Model
fetchFromSlug(string|int $slug)

Gets an entity from the supplied slug, which can either be an alias or an ID

static Model
invalid()

Generate an invalid object

Details

at line line 23
void delete()

Delete the object

Please note that this does not delete the object entirely from the database, it only hides it from users. You should overload this function if your object does not have a 'status' column which can be set to 'deleted'.

Return Value

void

at line line 28
void wipe()

Permanently delete the object from the database

Return Value

void

at line line 34
int getId()

Get an object's database ID

Return Value

int The ID

at line line 40
bool isValid()

See if an object is valid

Return Value

bool

at line line 46
bool isDeleted()

Check if a status of the object is 'deleted'

Return Value

bool

at line line 53
static Model fetchFromSlug(string|int $slug)

Gets an entity from the supplied slug, which can either be an alias or an ID

Parameters

string|int $slug The object's slug

Return Value

Model

at line line 67
static Model invalid()

Generate an invalid object

<?php $object = Team::invalid();

get_class($object); // Team
$object->isValid(); // false

Return Value

Model