Property | Type | Description | |
---|---|---|---|
$auto_prefix_models | string | Set a prefix for model names. This can be a namespace or any other abitrary prefix such as the PEAR naming convention. | |
$orm | The ORM instance used by this model instance to communicate with the database. | ||
$relating | string | The relationship type the model is currently resolving. | |
$relating_key | string | The foreign key of the "relating" relationship. | |
$relating_table | string | This is used during has_many_through eager loading. | |
$relationships | array | $relationships attributes will not be saved to the database, and are primarily used to hold relationships. __set and __get need the relationship method defined on the model to determine if the relationship exists. | |
$resultSetClass |
Method | Description | |
---|---|---|
__callStatic ( $method, $parameters ) | Calls static methods directly on the Orm\Wrapper | |
__get ( $property ) | Magic getter method, allows $model->property access to data. | |
__isset ( $property ) | Magic isset method, allows isset($model->property) to work correctly. | |
__set ( $property, $value ) | Magic setter method, allows $model->property = 'value' access to data. | |
as_array ( ) | Wrapper for Idiorm's as_array method. | |
delete ( ) | Delete the database row associated with this model instance. | |
factory ( $class_name, $connection_name = null ) | Factory method used to acquire instances of the given class. | |
get ( $property ) | Getter method, allows $model->get('property') access to data | |
get_resultSetClass ( ) | ||
hydrate ( $data ) | Hydrate this model instance with an associative array of data. | |
id ( ) | Get the database ID of this model instance. | |
is_dirty ( $property ) | Check whether the given field has changed since the object was created or saved | |
is_new ( ) : boolean | Check whether the model was the result of a call to create() or not | |
list_dirty_fields ( ) | Get the list of fields that need updating on next save | |
offsetExists ( integer | string $offset ) : boolean | ArrayAccess | |
offsetGet ( integer | string $offset ) : mixed | ArrayAccess | |
offsetSet ( integer | string $offset, mixed $value ) | ArrayAccess | |
offsetUnset ( integer | string $offset ) | ArrayAccess | |
save ( $ignore = false ) | Save the data associated with this model instance to the database. | |
set ( $property, string | null $value = null ) | Setter method, allows $model->set('property', 'value') access to data. | |
set_expr ( $property, string | null $value = null ) | Setter method, allows $model->set_expr('property', 'value') access to data. | |
set_orm ( $orm ) | Set the wrapped ORM instance associated with this Model instance. |
Method | Description | |
---|---|---|
_build_foreign_key_name ( $specified_foreign_key_name, $table_name ) | Build a foreign key based on a table name. If the first argument (the specified foreign key column name) is null, returns the second argument (the name of the table) with the default foreign key column suffix appended. | |
_class_name_to_table_name ( $class_name ) | Convert a namespace to the standard PEAR underscore format. | |
_get_id_column_name ( string $class_name ) | Return the ID column name to use for this class. If it is not set on the class, returns null. | |
_get_static_property ( $class_name, string $property, $default = null ) | Retrieve the value of a static property on a class. If the class or the property does not exist, returns the default value supplied as the third argument (which defaults to null). | |
_get_table_name ( string $class_name ) | Static method to get a table name given a class name. | |
_has_one_or_many ( $associated_class_name, $foreign_key_name = null, $foreign_key_name_in_current_models_table = null, $connection_name = null ) | Internal method to construct the queries for both the has_one and has_many methods. These two types of association are identical; the only difference is whether find_one or find_many is used to complete the method chain. | |
belongs_to ( string $associated_class_name, string $foreign_key_name = null, $foreign_key_name_in_associated_models_table = null, $connection_name = null ) | Helper method to manage one-to-one and one-to-many relations where the foreign key is on the base table. | |
has_many ( string $associated_class_name, string $foreign_key_name = null, $foreign_key_name_in_current_models_table = null, $connection_name = null ) | Helper method to manage one-to-many relations where the foreign key is on the associated table. | |
has_many_through ( string $associated_class_name, string $join_class_name = null, string $key_to_base_table = null, string $key_to_associated_table = null, $key_in_base_table = null, $key_in_associated_table = null, $connection_name = null ) | Helper method to manage many-to-many relationships via an intermediate model. See README for a full explanation of the parameters. | |
has_one ( string $associated_class_name, string $foreign_key_name = null, $foreign_key_name_in_current_models_table = null, $connection_name = null ) | Helper method to manage one-to-one relations where the foreign key is on the associated table. |
public static __callStatic ( $method, $parameters ) |
public __get ( $property ) |
public __isset ( $property ) |
public __set ( $property, $value ) |
protected static _build_foreign_key_name ( $specified_foreign_key_name, $table_name ) |
protected static _class_name_to_table_name ( $class_name ) |
protected static _get_id_column_name ( string $class_name ) | ||
$class_name | string |
protected static _get_static_property ( $class_name, string $property, $default = null ) | ||
$property | string |
protected static _get_table_name ( string $class_name ) | ||
$class_name | string |
protected _has_one_or_many ( $associated_class_name, $foreign_key_name = null, $foreign_key_name_in_current_models_table = null, $connection_name = null ) |
protected belongs_to ( string $associated_class_name, string $foreign_key_name = null, $foreign_key_name_in_associated_models_table = null, $connection_name = null ) | ||
$associated_class_name | string | |
$foreign_key_name | string |
public delete ( ) |
public static factory ( $class_name, $connection_name = null ) |
public get ( $property ) |
protected has_many_through ( string $associated_class_name, string $join_class_name = null, string $key_to_base_table = null, string $key_to_associated_table = null, $key_in_base_table = null, $key_in_associated_table = null, $connection_name = null ) | ||
$associated_class_name | string | |
$join_class_name | string | |
$key_to_base_table | string | |
$key_to_associated_table | string |
public hydrate ( $data ) |
public is_dirty ( $property ) |
public list_dirty_fields ( ) |
public offsetUnset ( integer | string $offset ) | ||
$offset | integer | string |
public save ( $ignore = false ) |
public set_orm ( $orm ) |
public static string $auto_prefix_models | ||
return | string |
public $orm |
public string $relating | ||
return | string |
public string $relating_key | ||
return | string |
public string $relating_table | ||
return | string |
public array $relationships | ||
return | array |