Method |
Description |
|
__call ( string $function, array $arguments ) : mixed |
Magically handle getters and setters. |
|
__construct ( array $properties = [] ) |
Constructor. |
|
all ( ) : array |
Return EVERY instance of this model from the database, with NO filtering. |
|
create ( $properties ) : self |
Create a new model from the given data. |
|
delete ( ) : boolean |
Delete the model from the database. Returns true if it was successful
or false if it was not. |
|
find_one ( integer $id ) : false | self |
Find a specific model by it's unique ID. |
|
find_one_by ( string $property, string $value ) : false | self |
Find a specific model by a given property value. |
|
flatten_props ( array $props ) : array |
Convert complex objects to strings to insert into the database. |
|
get_primary_key ( ) : string |
Get the column used as the primary key, defaults to 'id'. |
|
get_table_prefix ( ) : string |
Return configured table prefix. |
|
primary_key ( ) : integer |
Return the value of the primary key. |
|
properties ( ) : array |
Return an array of all the properties for this model. By default, returns
every class variable. |
|
query ( ) : Query |
Start a query to find models matching specific criteria. |
|
save ( ) : integer |
Save this model to the database. Will create a new record if the ID
property isn't set, or update an existing record if the ID property is
set. |
|
to_array ( ) : array |
Get all of the properties of this model as an array. |
|