프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$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 | ORM | The ORM instance used by this model instance to communicate with the database. | |
$short_table_names | boolean | Set true to to ignore namespace information when computing table names from class names. |
메소드 | 설명 | |
---|---|---|
__call ( string $name, array $arguments ) : boolean | ORMWrapper | Magic method to capture calls to undefined class methods. | |
__callStatic ( string $method, Array $parameters ) : Array | Calls static methods directly on the ORMWrapper | |
__get ( string $property ) : null | string | Magic getter method, allows $model->property access to data. | |
__isset ( string $property ) : boolean | Magic isset method, allows isset($model->property) to work correctly. | |
__set ( string $property, string $value ) : void | Magic setter method, allows $model->property = 'value' access to data. | |
__unset ( string $property ) : void | Magic unset method, allows unset($model->property) | |
as_array ( ) : Array | Wrapper for Idiorm's as_array method. | |
delete ( ) : null | Delete the database row associated with this model instance. | |
factory ( string $class_name, null | string $connection_name = null ) : ORMWrapper | Factory method used to acquire instances of the given class. | |
get ( string $property ) : string | Getter method, allows $model->get('property') access to data | |
hydrate ( Array $data ) : void | Hydrate this model instance with an associative array of data. | |
id ( ) : integer | Get the database ID of this model instance. | |
is_dirty ( string $property ) : boolean | 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 | |
save ( ) : null | Save the data associated with this model instance to the database. | |
set ( string | array $property, string | null $value = null ) : Model | Setter method, allows $model->set('property', 'value') access to data. | |
set_expr ( string | array $property, string | null $value = null ) : Model | Setter method, allows $model->set_expr('property', 'value') access to data. | |
set_orm ( ORM $orm ) : void | Set the wrapped ORM instance associated with this Model instance. |
메소드 | 설명 | |
---|---|---|
_build_foreign_key_name ( string $specified_foreign_key_name, string $table_name ) : string | 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 ( string $class_name ) : string | Convert a namespace to the standard PEAR underscore format. | |
_get_id_column_name ( string $class_name ) : string | null | Return the ID column name to use for this class. If it is not set on the class, returns null. | |
_get_static_property ( string $class_name, string $property, null | string $default = null ) : string | 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 ) : string | Static method to get a table name given a class name. | |
_has_one_or_many ( string $associated_class_name, null | string $foreign_key_name = null, null | string $foreign_key_name_in_current_models_table = null, null | string $connection_name = null ) : ORMWrapper | 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. | |
_use_short_table_name ( string $class_name ) : boolean | Should short table names, disregarding class namespaces, be computed? | |
belongs_to ( string $associated_class_name, null | string $foreign_key_name = null, null | string $foreign_key_name_in_associated_models_table = null, null | string $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, null | string $foreign_key_name = null, null | string $foreign_key_name_in_current_models_table = null, null | string $connection_name = null ) : ORMWrapper | Helper method to manage one-to-many relations where the foreign key is on the associated table. | |
has_many_through ( string $associated_class_name, null | string $join_class_name = null, null | string $key_to_base_table = null, null | string $key_to_associated_table = null, null | string $key_in_base_table = null, null | string $key_in_associated_table = null, null | string $connection_name = null ) : ORMWrapper | 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, null | string $foreign_key_name = null, null | string $foreign_key_name_in_current_models_table = null, null | string $connection_name = null ) : ORMWrapper | Helper method to manage one-to-one relations where the foreign key is on the associated table. |
public static __callStatic ( string $method, Array $parameters ) : Array | ||
$method | string | |
$parameters | Array | |
리턴 | Array |
protected static _class_name_to_table_name ( string $class_name ) : string | ||
$class_name | string | |
리턴 | string |
protected static _get_table_name ( string $class_name ) : string | ||
$class_name | string | |
리턴 | string |
protected _has_one_or_many ( string $associated_class_name, null | string $foreign_key_name = null, null | string $foreign_key_name_in_current_models_table = null, null | string $connection_name = null ) : ORMWrapper | ||
$associated_class_name | string | |
$foreign_key_name | null | string | |
$foreign_key_name_in_current_models_table | null | string | |
$connection_name | null | string | |
리턴 | ORMWrapper |
protected static _use_short_table_name ( string $class_name ) : boolean | ||
$class_name | string | |
리턴 | boolean |
protected belongs_to ( string $associated_class_name, null | string $foreign_key_name = null, null | string $foreign_key_name_in_associated_models_table = null, null | string $connection_name = null ) | ||
$associated_class_name | string | |
$foreign_key_name | null | string | |
$foreign_key_name_in_associated_models_table | null | string | |
$connection_name | null | string |
protected has_many ( string $associated_class_name, null | string $foreign_key_name = null, null | string $foreign_key_name_in_current_models_table = null, null | string $connection_name = null ) : ORMWrapper | ||
$associated_class_name | string | |
$foreign_key_name | null | string | |
$foreign_key_name_in_current_models_table | null | string | |
$connection_name | null | string | |
리턴 | ORMWrapper |
protected has_many_through ( string $associated_class_name, null | string $join_class_name = null, null | string $key_to_base_table = null, null | string $key_to_associated_table = null, null | string $key_in_base_table = null, null | string $key_in_associated_table = null, null | string $connection_name = null ) : ORMWrapper | ||
$associated_class_name | string | |
$join_class_name | null | string | |
$key_to_base_table | null | string | |
$key_to_associated_table | null | string | |
$key_in_base_table | null | string | |
$key_in_associated_table | null | string | |
$connection_name | null | string | |
리턴 | ORMWrapper |
protected has_one ( string $associated_class_name, null | string $foreign_key_name = null, null | string $foreign_key_name_in_current_models_table = null, null | string $connection_name = null ) : ORMWrapper | ||
$associated_class_name | string | |
$foreign_key_name | null | string | |
$foreign_key_name_in_current_models_table | null | string | |
$connection_name | null | string | |
리턴 | ORMWrapper |
public static string $auto_prefix_models | ||
리턴 | string |
public ORM $orm | ||
리턴 | ORM |
public static bool $short_table_names | ||
리턴 | boolean |