ModelInterface
interface ModelInterface
A base database object interface
Methods
Delete the object
Permanently delete the object from the database
Get an object's database ID
See if an object is valid
Check if a status of the object is 'deleted'
Gets an entity from the supplied slug, which can either be an alias or an ID
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'.
at line line 28
void
wipe()
Permanently delete the object from the database
at line line 34
int
getId()
Get an object's database ID
at line line 40
bool
isValid()
See if an object is valid
at line line 46
bool
isDeleted()
Check if a status of the object is 'deleted'
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
at line line 67
static Model
invalid()
Generate an invalid object
<?php
$object = Team::invalid();
get_class($object); // Team
$object->isValid(); // false