Bitrix API

StringType extends BaseType

Class StringType

Table of Contents

Constants

MODE_EDIT  = 'main.edit'
MODE_VIEW  = 'main.view'
RENDER_COMPONENT  = 'bitrix:main.field.string'
USER_TYPE_ID  = 'string'

Methods

checkFields()  : array<string|int, mixed>
This function is validator.
getAdminListEditHTML()  : string
getAdminListViewHtml()  : string
getDbColumnType()  : string
This function is called when new properties are added. We only support mysql data types.
getDefaultValue()  : mixed
getDescription()  : array<string|int, mixed>
getEditFormHtml()  : string
getFilterData()  : array<string|int, mixed>
getFilterHtml()  : string
getPublicEdit()  : string
getPublicText()  : string
getPublicView()  : string
getSettingsHtml()  : string
getUserTypeDescription()  : array<string|int, mixed>
isMandatorySupported()  : bool
isMultiplicitySupported()  : bool
onSearchIndex()  : string|null
This function should return a representation of the field value for the search.
prepareSettings()  : array<string|int, mixed>
This function is called before saving the property metadata to the database.
renderAdminListEdit()  : string
This function is called when the property value is displayed in the list of items in edit mode.
renderAdminListView()  : string
This function is called when the property value is displayed in the list of elements.
renderEdit()  : string
This function is called when editing property values in the public part of the site.
renderEditForm()  : string
This function is called when the form for editing the property value is displayed, for example, here /bitrix/admin/iblock_section_edit.php
renderField()  : string
renderFilter()  : string
This function is called when the filter is displayed on the list page.
renderSettings()  : string
This function is called when the property settings form is displayed.
renderText()  : string
renderView()  : string
This function is called when the property values are displayed in the public part of the site.

Constants

MODE_EDIT

public mixed MODE_EDIT = 'main.edit'

MODE_VIEW

public mixed MODE_VIEW = 'main.view'

RENDER_COMPONENT

public mixed RENDER_COMPONENT = 'bitrix:main.field.string'

USER_TYPE_ID

public mixed USER_TYPE_ID = 'string'

Methods

checkFields()

This function is validator.

public static checkFields(array<string|int, mixed> $userField, string|array<string|int, mixed> $value) : array<string|int, mixed>

Called from the CheckFields method of the $ USER_FIELD_MANAGER object, which can be called from the Add / Update methods of the property owner entity.

Parameters
$userField : array<string|int, mixed>
$value : string|array<string|int, mixed>
Return values
array<string|int, mixed>

getAdminListEditHTML()

public static getAdminListEditHTML(array<string|int, mixed> $userField, array<string|int, mixed>|null $additionalParameters) : string
Parameters
$userField : array<string|int, mixed>
$additionalParameters : array<string|int, mixed>|null
Return values
string

getAdminListViewHtml()

public static getAdminListViewHtml(array<string|int, mixed> $userField, array<string|int, mixed>|null $additionalParameters) : string
Parameters
$userField : array<string|int, mixed>
$additionalParameters : array<string|int, mixed>|null
Return values
string

getDbColumnType()

This function is called when new properties are added. We only support mysql data types.

public static getDbColumnType() : string

This function is called to construct the SQL column creation query to store non-multiple property values. Values of multiple properties are not stored in rows, but in columns (as in infoblocks) and the type of such a field in the database is always text

Return values
string

getDefaultValue()

public static getDefaultValue(array<string|int, mixed> $userField[, array<string|int, mixed> $additionalParameters = [] ]) : mixed
Parameters
$userField : array<string|int, mixed>
$additionalParameters : array<string|int, mixed> = []

getDescription()

public static getDescription() : array<string|int, mixed>
Return values
array<string|int, mixed>

getEditFormHtml()

public static getEditFormHtml(array<string|int, mixed> $userField, array<string|int, mixed>|null $additionalParameters) : string
Parameters
$userField : array<string|int, mixed>
$additionalParameters : array<string|int, mixed>|null
Return values
string

getFilterData()

public static getFilterData(null|array<string|int, mixed> $userField, array<string|int, mixed> $additionalSettings) : array<string|int, mixed>
Parameters
$userField : null|array<string|int, mixed>
$additionalSettings : array<string|int, mixed>
Return values
array<string|int, mixed>

getFilterHtml()

public static getFilterHtml(array<string|int, mixed> $userField, array<string|int, mixed>|null $additionalParameters) : string
Parameters
$userField : array<string|int, mixed>
$additionalParameters : array<string|int, mixed>|null
Return values
string

getPublicEdit()

public static getPublicEdit(array<string|int, mixed> $userField[, array<string|int, mixed>|null $additionalParameters = [] ]) : string
Parameters
$userField : array<string|int, mixed>
$additionalParameters : array<string|int, mixed>|null = []
Return values
string

getPublicText()

public static getPublicText(array<string|int, mixed> $userField) : string
Parameters
$userField : array<string|int, mixed>
Return values
string

getPublicView()

public static getPublicView(array<string|int, mixed> $userField[, array<string|int, mixed>|null $additionalParameters = [] ]) : string
Parameters
$userField : array<string|int, mixed>
$additionalParameters : array<string|int, mixed>|null = []
Return values
string

getSettingsHtml()

public static getSettingsHtml(array<string|int, mixed>|bool $userField, array<string|int, mixed>|null $additionalParameters, mixed $varsFromForm) : string
Parameters
$userField : array<string|int, mixed>|bool
$additionalParameters : array<string|int, mixed>|null
$varsFromForm : mixed
Return values
string

getUserTypeDescription()

public static getUserTypeDescription() : array<string|int, mixed>
Return values
array<string|int, mixed>

isMandatorySupported()

public static isMandatorySupported() : bool
Return values
bool

isMultiplicitySupported()

public static isMultiplicitySupported() : bool
Return values
bool

onSearchIndex()

This function should return a representation of the field value for the search.

public static onSearchIndex(array<string|int, mixed> $userField) : string|null

It is called from the OnSearchIndex method of the object $ USER_FIELD_MANAGER, which is also called the update function of the entity search index. For multiple values, the VALUE field is an array.

Parameters
$userField : array<string|int, mixed>
Return values
string|null

prepareSettings()

This function is called before saving the property metadata to the database.

public static prepareSettings(array<string|int, mixed> $userField) : array<string|int, mixed>

It should 'clear' the array with the settings of the instance of the property type. In order to accidentally / intentionally no one wrote down any garbage there.

Parameters
$userField : array<string|int, mixed>

An array describing the field. Warning! this description of the field has not yet been saved to the database!

Return values
array<string|int, mixed>

An array that will later be serialized and stored in the database.

renderAdminListEdit()

This function is called when the property value is displayed in the list of items in edit mode.

public static renderAdminListEdit(array<string|int, mixed> $userField, array<string|int, mixed>|null $additionalParameters) : string

Returns html to embed in a table cell. $AdditionalParameters elements are converted to html safe mode.

Parameters
$userField : array<string|int, mixed>

An array describing the field.

$additionalParameters : array<string|int, mixed>|null

An array of controls from the form. Contains the elements NAME and VALUE.

Return values
string

HTML

renderAdminListView()

This function is called when the property value is displayed in the list of elements.

public static renderAdminListView(array<string|int, mixed> $userField, array<string|int, mixed>|null $additionalParameters) : string

Returns html to embed in a table cell. $AdditionalParameters elements are converted to html safe mode.

Parameters
$userField : array<string|int, mixed>

An array describing the field.

$additionalParameters : array<string|int, mixed>|null

An array of controls from the form. Contains the elements NAME and VALUE.

Return values
string

HTML

renderEdit()

This function is called when editing property values in the public part of the site.

public static renderEdit(array<string|int, mixed> $userField[, array<string|int, mixed>|null $additionalParameters = [] ]) : string

Returns html. If the class does not provide such a function, then the type manager will call the component specified in the property metadata or system bitrix: system.field.edit

Parameters
$userField : array<string|int, mixed>

An array describing the field.

$additionalParameters : array<string|int, mixed>|null = []

Additional parameters (e.g. context).

Return values
string

HTML для вывода.

renderEditForm()

This function is called when the form for editing the property value is displayed, for example, here /bitrix/admin/iblock_section_edit.php

public static renderEditForm(array<string|int, mixed> $userField, array<string|int, mixed>|null $additionalParameters) : string

Returns html for embedding in a table cell in the entity editing form (on the "Advanced Properties" tab).

Parameters
$userField : array<string|int, mixed>

An array describing the field.

$additionalParameters : array<string|int, mixed>|null

An array of controls from the form. Contains the elements NAME and VALUE.

Return values
string

renderField()

public static renderField(array<string|int, mixed> $userField[, array<string|int, mixed>|null $additionalParameters = [] ]) : string
Parameters
$userField : array<string|int, mixed>
$additionalParameters : array<string|int, mixed>|null = []
Return values
string

renderFilter()

This function is called when the filter is displayed on the list page.

public static renderFilter(array<string|int, mixed> $userField, array<string|int, mixed>|null $additionalParameters) : string

Returns html to embed in a table cell. $additionalParameters elements are html safe.

Parameters
$userField : array<string|int, mixed>

An array describing the field.

$additionalParameters : array<string|int, mixed>|null

An array of controls from the form. Contains the elements NAME and VALUE.

Return values
string

renderSettings()

This function is called when the property settings form is displayed.

public static renderSettings(bool|array<string|int, mixed> $userField, array<string|int, mixed>|null $additionalParameters, mixed $varsFromForm) : string

Returns html for embedding in a 2-column table in the form usertype_edit.php

Parameters
$userField : bool|array<string|int, mixed>

An array describing the field. For a new (not yet added field - false)

$additionalParameters : array<string|int, mixed>|null

Array of advanced parameters

$varsFromForm : mixed
Return values
string

HTML

renderText()

public static renderText(array<string|int, mixed> $userField) : string
Parameters
$userField : array<string|int, mixed>
Return values
string

renderView()

This function is called when the property values are displayed in the public part of the site.

public static renderView(array<string|int, mixed> $userField[, array<string|int, mixed>|null $additionalParameters = [] ]) : string

Returns html. If the class does not provide such a function, then the type manager will call the component specified in the property metadata or system bitrix: system.field.view

Parameters
$userField : array<string|int, mixed>

An array describing the field.

$additionalParameters : array<string|int, mixed>|null = []

Additional parameters (e.g. context).

Return values
string

        
On this page

Search results