PHP 클래스 ActiveRecord\Table

This class manages a database table and is used by the Model class for reading and writing to its database table. There is one instance of Table for every table you have a model for.
파일 보기 프로젝트 열기: jpfuentes2/php-activerecord 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$cache_individual_model Whether to cache individual models or not (not to be confused with caching of table schemas).
$cache_model_expire Expiration period for model caching.
$callback A instance of CallBack for this model/table
$class
$columns Name/value pairs of columns in this table
$conn
$db_name Name of the database (optional)
$last_sql
$pk
$sequence Name of the sequence for this table (optional). Defaults to {$table}_seq
$table Name of the table.

공개 메소드들

메소드 설명
__construct ( $class_name )
cache_key_for_model ( $pk )
clear_cache ( $model_class_name = null )
create_joins ( $joins )
delete ( $data )
find ( $options )
find_by_sql ( $sql, $values = null, $readonly = false, $includes = null )
get_column_by_inflected_name ( $inflected_name )
get_fully_qualified_table_name ( $quote_name = true )
get_relationship ( $name, $strict = false ) : activerecord\HasOne | HasMany | BelongsTo Retrieve a relationship object for this table. Strict as true will throw an error if the relationship name does not exist.
has_relationship ( $name ) : boolean Does a given relationship exist?
insert ( &$data, $pk = null, $sequence_name = null )
load ( $model_class_name )
options_to_sql ( $options )
reestablish_connection ( $close = true )
update ( &$data, $where )

비공개 메소드들

메소드 설명
add_relationship ( Relationship $relationship ) Add a relationship.
execute_eager_load ( $models = [], $attrs = [], $includes = [] ) : void Executes an eager load of a given named relationship for this table.
get_meta_data ( )
map_names ( &$hash, &$map ) : array Replaces any aliases used in a hash based condition.
process_data ( $hash )
set_associations ( )
set_cache ( )
set_delegates ( ) Rebuild the delegates array into format that we can more easily work with in Model.
set_primary_key ( )
set_sequence_name ( )
set_setters_and_getters ( )
set_table_name ( )

메소드 상세

__construct() 공개 메소드

public __construct ( $class_name )

cache_key_for_model() 공개 메소드

public cache_key_for_model ( $pk )

clear_cache() 공개 정적인 메소드

public static clear_cache ( $model_class_name = null )

create_joins() 공개 메소드

public create_joins ( $joins )

delete() 공개 메소드

public delete ( $data )

find() 공개 메소드

public find ( $options )

find_by_sql() 공개 메소드

public find_by_sql ( $sql, $values = null, $readonly = false, $includes = null )

get_column_by_inflected_name() 공개 메소드

public get_column_by_inflected_name ( $inflected_name )

get_fully_qualified_table_name() 공개 메소드

public get_fully_qualified_table_name ( $quote_name = true )

get_relationship() 공개 메소드

Retrieve a relationship object for this table. Strict as true will throw an error if the relationship name does not exist.
public get_relationship ( $name, $strict = false ) : activerecord\HasOne | HasMany | BelongsTo
$name string name of Relationship
$strict bool
리턴 activerecord\HasOne | HasMany | BelongsTo Relationship or null

has_relationship() 공개 메소드

Does a given relationship exist?
public has_relationship ( $name ) : boolean
$name string name of Relationship
리턴 boolean

insert() 공개 메소드

public insert ( &$data, $pk = null, $sequence_name = null )

load() 공개 정적인 메소드

public static load ( $model_class_name )

options_to_sql() 공개 메소드

public options_to_sql ( $options )

reestablish_connection() 공개 메소드

public reestablish_connection ( $close = true )

update() 공개 메소드

public update ( &$data, $where )

프로퍼티 상세

$cache_individual_model 공개적으로 프로퍼티

Whether to cache individual models or not (not to be confused with caching of table schemas).
public $cache_individual_model

$cache_model_expire 공개적으로 프로퍼티

Expiration period for model caching.
public $cache_model_expire

$callback 공개적으로 프로퍼티

A instance of CallBack for this model/table
public $callback

$class 공개적으로 프로퍼티

public $class

$columns 공개적으로 프로퍼티

Name/value pairs of columns in this table
public $columns

$conn 공개적으로 프로퍼티

public $conn

$db_name 공개적으로 프로퍼티

Name of the database (optional)
public $db_name

$last_sql 공개적으로 프로퍼티

public $last_sql

$pk 공개적으로 프로퍼티

public $pk

$sequence 공개적으로 프로퍼티

Name of the sequence for this table (optional). Defaults to {$table}_seq
public $sequence

$table 공개적으로 프로퍼티

Name of the table.
public $table