Méthode |
Description |
|
__construct ( ) : void |
Initializes model fields and loads meta data. |
|
__get ( $name ) : mixed |
Magic method, called when accessing model properties externally. |
|
__isset ( $name ) : boolean |
Magic method, called when checking if an model property exists externally. |
|
__set ( $name, $value ) : void |
Magic method, called when setting model properties externally. |
|
__toString ( ) : string |
Magic method, called when displaying the model as a string. By default,
this method will return a JSON representation of model data. |
|
__unset ( $name ) : void |
Magic method, called when unsetting model properties externally. |
|
as_array ( ) : array |
Get the current model data as an array. Changed values are combined with
loaded values. |
|
as_json ( ) : string |
Get the current model data as a JSON string. |
|
changed ( ) : array |
Get the currently changed data. |
|
create ( Database_Query_Builder_Insert $query = NULL ) |
Create a new database record from model data. |
|
delete ( Database_Query_Builder_Delete $query = NULL, $limit = 1 ) : integer |
Delete model data from the database. |
|
deleted ( $state = NULL ) : boolean |
Get and set the model's "deleted" state. |
|
factory ( $name, array $values = NULL ) |
|
|
info ( $key = NULL, $value = NULL ) : mixed |
Store any type of information within the model. |
|
init ( ) : Hive_Meta |
Model meta initialization. Creates and returns a [Hive_Meta] object. |
|
loaded ( $state = NULL ) : boolean |
Get and set the model's "loaded" state. If a model is loaded, it has
loaded data, probably from a database. |
|
loading ( $state = NULL ) : boolean |
Get and set the model's "loading". If a model is loading, is is prepared
to receive unchanged, verified information. |
|
meta ( $model = NULL ) : Hive_Meta |
Get [Hive_Meta] object for a model. Creates a new singleton if the meta
object has not yet been created. |
|
prepared ( $state = NULL ) : boolean |
Get and set the model's "prepared" state. If a model is prepared, it can
be loaded. |
|
query_conditions ( Database_Query_Builder $query ) : object |
Applies WHERE conditions to a query. |
|
query_delete ( Database_Query_Builder_Delete $query = NULL, $limit = NULL ) : Database_Query_Builder_Delete |
Returns a DELETE query for the current model data. If no query is given,
a new query will be created. |
|
query_insert ( Database_Query_Builder_Insert $query = NULL ) : Database_Query_Builder_Insert |
Returns a INSERT query for the current model data. If no query is given,
a new query will be created. |
|
query_select ( Database_Query_Builder_Select $query = NULL, $limit = NULL ) : Database_Query_Builder_Select |
Returns a SELECT query for the current model data. If no query is given,
a new query will be created. |
|
query_update ( Database_Query_Builder_Update $query = NULL, $limit = NULL ) : Database_Query_Builder_Update |
Returns a UPDATE query for the current model data. If no query is given,
a new query will be created. |
|
read ( Database_Query_Builder_Select $query = NULL, $limit = 1 ) : Database_Result |
Read model data from the database. |
|
reset ( ) |
Reset the model to a completely unloaded state. Clears all loaded and
changed data and resets the "prepared" and "loaded" states. |
|
save ( ) |
Update or create the model depending on internal state. |
|
select_list ( $key, $value, Database_Query_Builder_Select $query = NULL ) : array |
Get a simple key => value array. |
|
total ( Database_Query_Builder_Select $query = NULL ) : integer |
Get the total number of records matching the current model. |
|
update ( Database_Query_Builder_Update $query = NULL, $limit = 1 ) : integer |
Update model data in the database. |
|
validate ( $context = NULL, array $data = NULL ) : Validate |
Validate the current model data. Applies the field label, filters,
rules, and callbacks to the data. |
|
values ( $values, $clean = FALSE ) |
Set multiple values at once. Only values with fields will be used. |
|