PHP 클래스 atk4\data\Reference_One

상속: extends Reference
파일 보기 프로젝트 열기: atk4/data

공개 프로퍼티들

프로퍼티 타입 설명
$dateTimeClass For example, 'DateTime', 'Carbon' etc.
$dateTimeZoneClass For example, 'DateTimeZone', 'Carbon' etc.
$default mixed Default value of field.
$mandatory boolean | string Is field mandatory? By default fields are not mandatory.
$never_persist boolean Setting this to true will never actually store the field in the database. It will action as normal, but will be skipped by update/insert.
$persist_format string For example, for date it can be 'Y-m-d', for datetime - 'Y-m-d H:i:s' etc.
$persist_timezone string For example, 'IST', 'UTC', 'Europe/Riga' etc.
$read_only boolean For example, expressions are read only.
$serialize null | boolean | array Value can be array [$encode_callback, $decode_callback].
$typecast null | boolean | array Value can be array [$typecast_save_callback, $typecast_load_callback].
$ui array By default hasOne relation ID field should be editable in forms, but not visible in grids. UI should respect these flags.

보호된 프로퍼티들

프로퍼티 타입 설명
$join Join | null Points to the join if we are part of one.

공개 메소드들

메소드 설명
init ( ) Reference_One will also add a field corresponding to 'our_field' unless it exists of course.
ref ( array $defaults = [] ) : Model If owner model is loaded, then return referenced model with respective record loaded.

보호된 메소드들

메소드 설명
referenceOurValue ( ) : Field Returns our field or id field.

메소드 상세

init() 공개 메소드

Reference_One will also add a field corresponding to 'our_field' unless it exists of course.
public init ( )

ref() 공개 메소드

If owner model is not loaded, then return referenced model with condition set. This can happen in case of deep traversal $m->ref('Many')->ref('one_id'), for example.
public ref ( array $defaults = [] ) : Model
$defaults array Properties
리턴 Model

referenceOurValue() 보호된 메소드

Returns our field or id field.
protected referenceOurValue ( ) : Field
리턴 Field

프로퍼티 상세

$dateTimeClass 공개적으로 프로퍼티

For example, 'DateTime', 'Carbon' etc.
public $dateTimeClass

$dateTimeZoneClass 공개적으로 프로퍼티

For example, 'DateTimeZone', 'Carbon' etc.
public $dateTimeZoneClass

$default 공개적으로 프로퍼티

Default value of field.
public mixed $default
리턴 mixed

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

Points to the join if we are part of one.
protected Join,atk4\data|null $join
리턴 Join | null

$mandatory 공개적으로 프로퍼티

Is field mandatory? By default fields are not mandatory.
public bool|string $mandatory
리턴 boolean | string

$never_persist 공개적으로 프로퍼티

Setting this to true will never actually store the field in the database. It will action as normal, but will be skipped by update/insert.
public bool $never_persist
리턴 boolean

$persist_format 공개적으로 프로퍼티

For example, for date it can be 'Y-m-d', for datetime - 'Y-m-d H:i:s' etc.
public string $persist_format
리턴 string

$persist_timezone 공개적으로 프로퍼티

For example, 'IST', 'UTC', 'Europe/Riga' etc.
public string $persist_timezone
리턴 string

$read_only 공개적으로 프로퍼티

For example, expressions are read only.
public bool $read_only
리턴 boolean

$serialize 공개적으로 프로퍼티

Value can be array [$encode_callback, $decode_callback].
public null|bool|array $serialize
리턴 null | boolean | array

$typecast 공개적으로 프로퍼티

Value can be array [$typecast_save_callback, $typecast_load_callback].
public null|bool|array $typecast
리턴 null | boolean | array

$ui 공개적으로 프로퍼티

By default hasOne relation ID field should be editable in forms, but not visible in grids. UI should respect these flags.
public array $ui
리턴 array