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.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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