PHP 클래스 ActiveRecord\AbstractRelationship

또한 보기: http://www.phpactiverecord.org/guides/associations
상속: implements activerecord\InterfaceRelationship
파일 보기 프로젝트 열기: jpfuentes2/php-activerecord

공개 프로퍼티들

프로퍼티 타입 설명
$attribute_name string Name to be used that will trigger call to the relationship.
$class_name string Class name of the associated model.
$foreign_key string Name of the foreign key.

보호된 프로퍼티들

프로퍼티 타입 설명
$options array Options of the relationship.
$poly_relationship boolean Is the relationship single or multi.
$valid_association_options array List of valid options for relationships.

공개 메소드들

메소드 설명
__construct ( array $options = [] ) : mixed Constructs a relationship.
build_association ( activerecord\Model $model, array $attributes = [], $guard_attributes = true ) : activerecord\Model Creates a new instance of specified {@link Model} with the attributes pre-loaded.
construct_inner_join_sql ( Table $from_table, boolean $using_through = false, string $alias = null ) : string Creates INNER JOIN SQL for associations.
create_association ( activerecord\Model $model, array $attributes = [], $guard_attributes = true ) : activerecord\Model Creates a new instance of {@link Model} and invokes save.
is_poly ( ) : boolean What is this relationship's cardinality?
load ( activerecord\Model $model ) This will load the related model data.

보호된 메소드들

메소드 설명
append_record_to_associate ( activerecord\Model $associate, activerecord\Model $record )
create_conditions_from_keys ( activerecord\Model $model, $condition_keys = [], $value_keys = [] )
get_table ( )
merge_association_options ( $options )
query_and_attach_related_models_eagerly ( Table $table, $models, $attributes, $includes = [], $query_keys = [], $model_values_keys = [] ) : void Eagerly loads relationships for $models.
set_class_name ( $class_name )
set_inferred_class_name ( ) : void Infers the $this->class_name based on $this->attribute_name.
unset_non_finder_options ( $options )

메소드 상세

__construct() 공개 메소드

Constructs a relationship.
public __construct ( array $options = [] ) : mixed
$options array Options for the relationship (see {@link valid_association_options})
리턴 mixed

append_record_to_associate() 보호된 메소드

protected append_record_to_associate ( activerecord\Model $associate, activerecord\Model $record )
$associate activerecord\Model
$record activerecord\Model

build_association() 공개 메소드

Creates a new instance of specified {@link Model} with the attributes pre-loaded.
public build_association ( activerecord\Model $model, array $attributes = [], $guard_attributes = true ) : activerecord\Model
$model activerecord\Model The model which holds this association
$attributes array Hash containing attributes to initialize the model with
리턴 activerecord\Model

construct_inner_join_sql() 공개 메소드

Creates INNER JOIN SQL for associations.
public construct_inner_join_sql ( Table $from_table, boolean $using_through = false, string $alias = null ) : string
$from_table Table the table used for the FROM SQL statement
$using_through boolean is this a THROUGH relationship?
$alias string a table alias for when a table is being joined twice
리턴 string SQL INNER JOIN fragment

create_association() 공개 메소드

Creates a new instance of {@link Model} and invokes save.
public create_association ( activerecord\Model $model, array $attributes = [], $guard_attributes = true ) : activerecord\Model
$model activerecord\Model The model which holds this association
$attributes array Hash containing attributes to initialize the model with
리턴 activerecord\Model

create_conditions_from_keys() 보호된 메소드

protected create_conditions_from_keys ( activerecord\Model $model, $condition_keys = [], $value_keys = [] )
$model activerecord\Model

get_table() 보호된 메소드

protected get_table ( )

is_poly() 공개 메소드

What is this relationship's cardinality?
public is_poly ( ) : boolean
리턴 boolean

load() 추상적인 공개 메소드

This will load the related model data.
abstract public load ( activerecord\Model $model )
$model activerecord\Model The model this relationship belongs to

merge_association_options() 보호된 메소드

protected merge_association_options ( $options )

set_class_name() 보호된 메소드

protected set_class_name ( $class_name )

set_inferred_class_name() 보호된 메소드

Will try to guess the appropriate class by singularizing and uppercasing $this->attribute_name.
또한 보기: attribute_name
protected set_inferred_class_name ( ) : void
리턴 void

unset_non_finder_options() 보호된 메소드

protected unset_non_finder_options ( $options )

프로퍼티 상세

$attribute_name 공개적으로 프로퍼티

Name to be used that will trigger call to the relationship.
public string $attribute_name
리턴 string

$class_name 공개적으로 프로퍼티

Class name of the associated model.
public string $class_name
리턴 string

$foreign_key 공개적으로 프로퍼티

Name of the foreign key.
public string $foreign_key
리턴 string

$options 보호되어 있는 프로퍼티

Options of the relationship.
protected array $options
리턴 array

$poly_relationship 보호되어 있는 프로퍼티

Is the relationship single or multi.
protected bool $poly_relationship
리턴 boolean

$valid_association_options 보호되어 있는 정적으로 프로퍼티

List of valid options for relationships.
protected static array $valid_association_options
리턴 array