Method |
Description |
|
__get ( $name ) : mixed |
Get the value of a field. |
|
__isset ( $name ) : boolean |
Check if a value exists within the mode. |
|
__set ( $name, $value ) : void |
Set the value of a field. |
|
__sleep ( ) : array |
Allow serialization of initialized object containing related objects as a Database_Result |
|
__toString ( ) : string |
Returns the model name. |
|
__unset ( $name ) : void |
Unset the changed the value of a field. |
|
_unique_field ( Validate $array, $field ) : void |
Callback for validating unique fields. |
|
as_array ( $verbose = FALSE ) : array |
Get the model data as an associative array. |
|
changed ( $field = NULL ) : array |
Get all of the changed fields as an associative array. |
|
check ( array $data = NULL ) : array |
Check the given data is valid. Only values that have editable fields
will be included and checked. |
|
count ( Database_Query_Builder_Select $query = NULL ) |
Count the number of records using the current data. |
|
create ( ) |
Create a new record using the current data. |
|
db ( $db = NULL ) : string |
Gets and sets the database instance used for this model. |
|
delete ( Database_Query_Builder_Delete $query = NULL ) |
Delete the current record: |
|
factory ( $name, array $values = NULL ) : Sprig |
Load an empty sprig model. |
|
field ( $name ) : Sprig_Field |
Get a single field object. |
|
fields ( ) : array |
Get all fields as an associative array. |
|
fk ( $table = NULL ) : string |
Returns the foreign key of the model, optionally with a table name. |
|
input ( $name, array $attr = NULL ) : string |
Return a single field input. |
|
inputs ( $labels = TRUE ) : array |
Get all fields as an array of inputs. |
|
label ( $field, array $attr = NULL ) : string |
Return a single field label. |
|
load ( Database_Query_Builder_Select $query = NULL, $limit = 1 ) |
Load a single record using the current data. |
|
loaded ( ) : boolean |
Object data loaded status. |
|
pk ( $table = NULL ) : string |
Returns the primary key of the model, optionally with a table name. |
|
relate ( $name, $value ) |
Adds a relationship to the model |
|
related ( $name, $value ) : boolean |
Determines if this object has a relation |
|
select_list ( $key = NULL, $value = NULL ) : array |
Get all of the records for this table as an associative array. |
|
state ( $state = NULL ) : string |
Get or set the model status. |
|
table ( $table = NULL ) : string |
Gets and sets the table name of the model. |
|
tk ( $table = NULL ) : string |
Returns the title key of the model, optionally with a table name. |
|
unrelate ( $name, $value ) |
Removes a relationship to the model |
|
update ( ) |
Update the current record using the current data. |
|
values ( array $values ) |
Load all of the values in an associative array. Ignores all fields are
not in the model. |
|
verbose ( $field ) : string |
Return a single field value in verbose form. |
|