PHP 클래스 atk4\data\Field

상속: use trait atk4\core\TrackableTrait
파일 보기 프로젝트 열기: atk4/data

공개 프로퍼티들

프로퍼티 타입 설명
$actual string | null Actual field name.
$dateTimeClass For example, 'DateTime', 'Carbon' etc.
$dateTimeZoneClass For example, 'DateTimeZone', 'Carbon' etc.
$default mixed Default value of field.
$enum array | null For several types enum can provide list of available options.
$join Join | null Join object.
$mandatory boolean | string Can contain error message for UI.
$never_persist boolean Setting this to true will never actually load or store the field in the database. It will action as normal, but will be skipped by load/iterate/update/insert.
$never_save 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].
$system boolean Is it system field? System fields will be always loaded and saved.
$type string Values are: 'string', 'boolean', 'integer', 'money', 'float', 'date', 'datetime', 'time', 'array', 'object'. Can also be set to unspecified type for your own custom handling.
$typecast null | boolean | array Value can be array [$typecast_save_callback, $typecast_load_callback].
$ui array Array with UI flags like editable, visible and hidden.

공개 메소드들

메소드 설명
__construct ( array $defaults = [] ) Constructor. You can pass field properties as array.
__debugInfo ( ) : array Returns array with useful debug info for var_dump.
get ( ) : mixed Returns field value.
isEditable ( ) : boolean Returns if field should be editable in UI.
isHidden ( ) : boolean Returns if field should be hidden in UI.
isVisible ( ) : boolean Returns if field should be visible in UI.
normalize ( mixed $value ) : mixed Depending on the type of a current field, this will perform some normalization for strict types.
set ( mixed $value ) Sets field value.

메소드 상세

__construct() 공개 메소드

Constructor. You can pass field properties as array.
public __construct ( array $defaults = [] )
$defaults array

__debugInfo() 공개 메소드

Returns array with useful debug info for var_dump.
public __debugInfo ( ) : array
리턴 array

get() 공개 메소드

Returns field value.
public get ( ) : mixed
리턴 mixed

isEditable() 공개 메소드

Returns if field should be editable in UI.
public isEditable ( ) : boolean
리턴 boolean

isHidden() 공개 메소드

Returns if field should be hidden in UI.
public isHidden ( ) : boolean
리턴 boolean

isVisible() 공개 메소드

Returns if field should be visible in UI.
public isVisible ( ) : boolean
리턴 boolean

normalize() 공개 메소드

Depending on the type of a current field, this will perform some normalization for strict types.
public normalize ( mixed $value ) : mixed
$value mixed
리턴 mixed

set() 공개 메소드

Sets field value.
public set ( mixed $value )
$value mixed

프로퍼티 상세

$actual 공개적으로 프로퍼티

Actual field name.
public string|null $actual
리턴 string | null

$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

$enum 공개적으로 프로퍼티

For several types enum can provide list of available options.
public array|null $enum
리턴 array | null

$join 공개적으로 프로퍼티

Join object.
public Join,atk4\data|null $join
리턴 Join | null

$mandatory 공개적으로 프로퍼티

Can contain error message for UI.
public bool|string $mandatory
리턴 boolean | string

$never_persist 공개적으로 프로퍼티

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

$never_save 공개적으로 프로퍼티

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_save
리턴 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

$system 공개적으로 프로퍼티

Is it system field? System fields will be always loaded and saved.
public bool $system
리턴 boolean

$type 공개적으로 프로퍼티

Values are: 'string', 'boolean', 'integer', 'money', 'float', 'date', 'datetime', 'time', 'array', 'object'. Can also be set to unspecified type for your own custom handling.
public string $type
리턴 string

$typecast 공개적으로 프로퍼티

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

$ui 공개적으로 프로퍼티

Array with UI flags like editable, visible and hidden.
public array $ui
리턴 array