Bitrix API

ElementType extends StringType

Class ElementType

Table of Contents

Constants

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

Methods

checkFields()  : array<string|int, mixed>
This function is validator.
checkPermission()  : bool
getAdminListEditHTML()  : string
getAdminListViewHtml()  : string
getAvailableTypes()  : array<string|int, mixed>
getDbColumnType()  : string
This function is called when new properties are added. We only support mysql data types.
getDefaultValue()  : mixed
getDescription()  : array<string|int, mixed>
getDestSelectorOptions()  : mixed
getDestSelectorParametersForFilter()  : array<string|int, mixed>
Return parameters for destination selector of userfield with $settings.
getDynamicEntityTitles()  : array<string|int, mixed>
Return map of dynamic entity titles.
getEditFormHtml()  : string
getEnableEntityTypesForSelectorOptions()  : array<string|int, mixed>
getEntityTypeNames()  : array<string|int, mixed>
getFilterData()  : array<string|int, mixed>
getFilterHtml()  : string
getLongEntityType()  : string
getPossibleEntityTypes()  : array<string|int, mixed>
getPublicEdit()  : string
getPublicText()  : string
getPublicView()  : string
getSelectorEntityTypes()  : array<string|int, mixed>
getSettingsHtml()  : string
getShortEntityType()  : string
getUseInUserfieldTypes()  : array<string|int, mixed>
getUserTypeDescription()  : array<string|int, mixed>
getValueByIdentifier()  : string
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:crm.field.element'

Methods

checkFields()

This function is validator.

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

checkPermission()

public static checkPermission(array<string|int, mixed> $userField[, bool|int $userId = false ]) : bool
Parameters
$userField : array<string|int, mixed>
$userId : bool|int = false
Tags
throws
LoaderException
Return values
bool

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

getAvailableTypes()

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

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>

getDestSelectorOptions()

public static getDestSelectorOptions(array<string|int, mixed> $destSelectorParams) : mixed
Parameters
$destSelectorParams : array<string|int, mixed>

getDestSelectorParametersForFilter()

Return parameters for destination selector of userfield with $settings.

public static getDestSelectorParametersForFilter(array<string|int, mixed> $settings, bool $isMultiple) : array<string|int, mixed>
Parameters
$settings : array<string|int, mixed>
$isMultiple : bool
Return values
array<string|int, mixed>

getDynamicEntityTitles()

Return map of dynamic entity titles.

public static getDynamicEntityTitles() : 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

getEnableEntityTypesForSelectorOptions()

public static getEnableEntityTypesForSelectorOptions([array<string|int, mixed>|null $availableTypes = [] ][, array<string|int, mixed>|null $crmDynamicTitles = [] ]) : array<string|int, mixed>
Parameters
$availableTypes : array<string|int, mixed>|null = []
$crmDynamicTitles : array<string|int, mixed>|null = []
Return values
array<string|int, mixed>

getEntityTypeNames()

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

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

getLongEntityType()

public static getLongEntityType(string $type) : string
Parameters
$type : string
Return values
string

getPossibleEntityTypes()

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

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

getSelectorEntityTypes()

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

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

getShortEntityType()

public static getShortEntityType(string $type) : string
Parameters
$type : string
Return values
string

getUseInUserfieldTypes()

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

getUserTypeDescription()

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

getValueByIdentifier()

public static getValueByIdentifier(ItemIdentifier $identifier) : string
Parameters
$identifier : ItemIdentifier
Return values
string

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