PHP Класс atk4\data\Field

Наследование: use trait atk4\core\TrackableTrait
Показать файл Открыть проект

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

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