Bitrix API

ArrayField extends ScalarField

Scalar entity field class for non-array and non-object data types

Tags
subpackage

main

Table of Contents

Constants

SERIALIZATION_TYPE_JSON  = 'json'
SERIALIZATION_TYPE_PHP  = 'php'

Methods

__construct()  : mixed
ScalarField constructor.
addFetchDataModifier()  : $this
addSaveDataModifier()  : $this
addValidator()  : $this
cast()  : array<string|int, mixed>|SqlExpression
Casts value strictly to field type.
configureAutocomplete()  : $this
configureBinary()  : ScalarField
configureColumnName()  : $this
configureDefaultValue()  : $this
configureNullable()  : ScalarField
configurePrimary()  : $this
configurePrivate()  : ScalarField
configureRequired()  : $this
configureSerializationJson()  : $this
Sets json serialization format
configureSerializationPhp()  : $this
Sets php serialization format
configureSerializeCallback()  : $this
Custom encode handler
configureSerialized()  : $this
configureTitle()  : $this
Lang phrase
configureUnique()  : $this
configureUnserializeCallback()  : $this
Custom decode handler
convertValueFromDb()  : mixed|string
Returns value converted from SQL raw result.
convertValueToDb()  : string
Returns raw SQL with escaped and quoted value.
decode()  : array<string|int, mixed>
decodeJson()  : mixed
decodePhp()  : array<string|int, mixed>
encode()  : string
encodeJson()  : mixed
encodePhp()  : string
getClassByOldDataType()  : bool
getColumnName()  : mixed
getConnection()  : Connection
getDataType()  : null|string
getDefaultValue()  : callable|mixed|null
getEntity()  : mixed
getFetchDataModifiers()  : array<string|int, mixed>|array<string|int, callable>|null
getGetterTypeHint()  : string
getLangCode()  : mixed
getName()  : mixed
getOldDataTypeByClass()  : bool
getOldDataTypeByField()  : bool
getParameter()  : mixed
getParentField()  : Field
getSaveDataModifiers()  : array<string|int, mixed>|array<string|int, callable>|null
getSerializationType()  : string
getSetterTypeHint()  : string
getTitle()  : mixed
getTypeMask()  : int
getValidators()  : array<string|int, callable>|array<string|int, Validator>
hasParameter()  : mixed
isAutocomplete()  : mixed
isBinary()  : bool
isNullable()  : bool
isPrimary()  : mixed
isPrivate()  : bool
isRequired()  : mixed
isSerialized()  : bool
isUnique()  : mixed
isValueEmpty()  : mixed
modifyValueBeforeSave()  : mixed
postInitialize()  : null
Called after being initialized by Entity
resetEntity()  : mixed
serialize()  : mixed
setColumnName()  : mixed
setConnection()  : mixed
setEntity()  : mixed
setName()  : mixed
setParameter()  : mixed
setParentField()  : mixed
setSerialized()  : mixed
unserialize()  : mixed
validateValue()  : Result

Constants

SERIALIZATION_TYPE_JSON

public mixed SERIALIZATION_TYPE_JSON = 'json'

SERIALIZATION_TYPE_PHP

public mixed SERIALIZATION_TYPE_PHP = 'php'

Methods

__construct()

ScalarField constructor.

public __construct(mixed $name[, mixed $parameters = [] ]) : mixed
Parameters
$name : mixed
$parameters : mixed = []

deprecated, use configure* and add* methods instead

addFetchDataModifier()

public addFetchDataModifier(callable $modifier) : $this
Parameters
$modifier : callable
Tags
throws
SystemException
Return values
$this

addSaveDataModifier()

public addSaveDataModifier(callable $modifier) : $this
Parameters
$modifier : callable
Tags
throws
SystemException
Return values
$this

addValidator()

public addValidator(Validator|callable $validator) : $this
Parameters
$validator : Validator|callable
Tags
throws
SystemException
Return values
$this

cast()

Casts value strictly to field type.

public cast(mixed $value) : array<string|int, mixed>|SqlExpression
Parameters
$value : mixed
Return values
array<string|int, mixed>|SqlExpression

configureAutocomplete()

public configureAutocomplete([bool $value = true ]) : $this
Parameters
$value : bool = true
Return values
$this

configureColumnName()

public configureColumnName(string $value) : $this
Parameters
$value : string
Return values
$this

configureDefaultValue()

public configureDefaultValue(callable|mixed $value) : $this
Parameters
$value : callable|mixed
Return values
$this

configurePrimary()

public configurePrimary([bool $value = true ]) : $this
Parameters
$value : bool = true
Return values
$this

configureRequired()

public configureRequired([bool $value = true ]) : $this
Parameters
$value : bool = true
Return values
$this

configureSerializationJson()

Sets json serialization format

public configureSerializationJson() : $this
Return values
$this

configureSerializationPhp()

Sets php serialization format

public configureSerializationPhp() : $this
Return values
$this

configureSerializeCallback()

Custom encode handler

public configureSerializeCallback(callable $callback) : $this
Parameters
$callback : callable
Return values
$this

configureSerialized()

public configureSerialized() : $this
Tags
throws
SystemException
Return values
$this

configureTitle()

Lang phrase

public configureTitle(mixed $title) : $this
Parameters
$title : mixed
Return values
$this

configureUnique()

public configureUnique([bool $value = true ]) : $this
Parameters
$value : bool = true
Return values
$this

configureUnserializeCallback()

Custom decode handler

public configureUnserializeCallback(mixed $callback) : $this
Parameters
$callback : mixed
Return values
$this

convertValueFromDb()

Returns value converted from SQL raw result.

public convertValueFromDb(mixed $value) : mixed|string
Parameters
$value : mixed
Tags
throws
SystemException
Return values
mixed|string

convertValueToDb()

Returns raw SQL with escaped and quoted value.

public convertValueToDb(mixed $value) : string
Parameters
$value : mixed
Tags
throws
SystemException
Return values
string

decode()

public decode(string $value) : array<string|int, mixed>
Parameters
$value : string
Return values
array<string|int, mixed>

decodeJson()

public decodeJson(mixed $value) : mixed
Parameters
$value : mixed
Tags
throws
ArgumentException

decodePhp()

public decodePhp(mixed $value) : array<string|int, mixed>
Parameters
$value : mixed
Return values
array<string|int, mixed>

encode()

public encode(array<string|int, mixed> $value) : string
Parameters
$value : array<string|int, mixed>
Return values
string

encodeJson()

public encodeJson(mixed $value) : mixed
Parameters
$value : mixed
Tags
throws
ArgumentException

encodePhp()

public encodePhp(mixed $value) : string
Parameters
$value : mixed
Return values
string

getClassByOldDataType()

public static getClassByOldDataType(mixed $dateType) : bool
Parameters
$dateType : mixed
Return values
bool

getDataType()

public getDataType() : null|string
Return values
null|string

getDefaultValue()

public getDefaultValue([array<string|int, mixed> $row = null ]) : callable|mixed|null
Parameters
$row : array<string|int, mixed> = null

ORM data row in case of dependency value on other values

Return values
callable|mixed|null

getEntity()

public getEntity() : mixed

getFetchDataModifiers()

public getFetchDataModifiers() : array<string|int, mixed>|array<string|int, callable>|null
Tags
throws
SystemException
Return values
array<string|int, mixed>|array<string|int, callable>|null

getGetterTypeHint()

public getGetterTypeHint() : string
Return values
string

getLangCode()

public getLangCode() : mixed

getName()

public getName() : mixed

getOldDataTypeByClass()

public static getOldDataTypeByClass(mixed $class) : bool
Parameters
$class : mixed
Return values
bool

getOldDataTypeByField()

public static getOldDataTypeByField(Field $field) : bool
Parameters
$field : Field
Return values
bool

getParameter()

public getParameter(mixed $name) : mixed
Parameters
$name : mixed

getSaveDataModifiers()

public getSaveDataModifiers() : array<string|int, mixed>|array<string|int, callable>|null
Tags
throws
SystemException
Return values
array<string|int, mixed>|array<string|int, callable>|null

getSerializationType()

public getSerializationType() : string
Return values
string

getSetterTypeHint()

public getSetterTypeHint() : string
Return values
string

getTitle()

public getTitle() : mixed

getTypeMask()

public getTypeMask() : int
Return values
int

getValidators()

public getValidators() : array<string|int, callable>|array<string|int, Validator>
Tags
throws
SystemException
Return values
array<string|int, callable>|array<string|int, Validator>

hasParameter()

public hasParameter(mixed $name) : mixed
Parameters
$name : mixed

isBinary()

public isBinary() : bool
Return values
bool

isNullable()

public isNullable() : bool
Return values
bool

isPrivate()

public isPrivate() : bool
Return values
bool

isSerialized()

public isSerialized() : bool
Return values
bool

isValueEmpty()

public isValueEmpty(mixed $value) : mixed
Parameters
$value : mixed

modifyValueBeforeSave()

public modifyValueBeforeSave(mixed $value, mixed $data) : mixed
Parameters
$value : mixed
$data : mixed
Tags
throws
SystemException

postInitialize()

Called after being initialized by Entity

public postInitialize() : null
Return values
null

resetEntity()

public resetEntity() : mixed

serialize()

public serialize(mixed $value) : mixed
Parameters
$value : mixed

setColumnName()

public setColumnName(string $column_name) : mixed
Parameters
$column_name : string

setConnection()

public setConnection(mixed $connection) : mixed
Parameters
$connection : mixed

setEntity()

public setEntity(Entity $entity) : mixed
Parameters
$entity : Entity
Tags
throws
SystemException

setName()

public setName(mixed $name) : mixed
Parameters
$name : mixed

setParameter()

public setParameter(mixed $name, mixed $value) : mixed
Parameters
$name : mixed
$value : mixed

setParentField()

public setParentField(Field $parentField) : mixed
Parameters
$parentField : Field

setSerialized()

public setSerialized() : mixed
Tags
throws
SystemException

unserialize()

public unserialize(mixed $value) : mixed
Parameters
$value : mixed

validateValue()

public validateValue(mixed $value, mixed $primary, mixed $row, Result $result) : Result
Parameters
$value : mixed
$primary : mixed
$row : mixed
$result : Result
Tags
throws
SystemException
Return values
Result

        
On this page

Search results