1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Класс CAllUserTypeEntity
Граф наследования:CAllUserTypeEntity:
CDBResult CDBResultMysql CAllDBResult CAllDBResult CUserTypeEntity

Открытые члены

 CreatePropertyTables ($entity_id)
 CheckFields ($ID, $arFields, $bCheckUserType=true)
 Add ($arFields, $bCheckUserType=true)
 Update ($ID, $arFields)
 Delete ($ID)
 DropEntity ($entity_id)
 Fetch ()
Открытые члены унаследованные от CDBResult
 SelectedRowsCount ()
 AffectedRowsCount ()
 FieldsCount ()
 FieldName ($iCol)
Открытые члены унаследованные от CAllDBResult
 __construct ($res=null)
 __sleep ()
 NavQuery ($strSql, $cnt, $arNavStartParams, $bIgnoreErrors=false)
 NavContinue ()
 IsNavPrint ()
 NavPrint ($title, $show_allways=false, $StyleText="text", $template_path=false)
 GetNavPrint ($title, $show_allways=false, $StyleText="text", $template_path=false, $arDeleteParam=false)
 ExtractFields ($strPrefix="str_", $bDoEncode=true)
 ExtractEditFields ($strPrefix="str_")
 GetNext ($bTextHtmlAuto=true, $use_tilda=true)
 InitNavStartVars ($nPageSize=0, $bShowAll=true, $iNumPage=false)
 NavStart ($nPageSize=0, $bShowAll=true, $iNumPage=false)
 DBNavStart ()
 InitFromArray ($arr)
 NavNext ($bSetGlobalVars=true, $strPrefix="str_", $bDoEncode=true, $bSkipEntities=true)
 GetPageNavString ($navigationTitle, $templateName="", $showAlways=false, $parentComponent=null)
 GetPageNavStringEx (&$navComponentObject, $navigationTitle, $templateName="", $showAlways=false, $parentComponent=null, $componentParams=[])
 SetUserFields ($arUserFields)

Открытые статические члены

static GetByID ($ID)
static GetList ($aSort=[], $aFilter=[])
Открытые статические члены унаследованные от CAllDBResult
static NavStringForCache ($nPageSize=0, $bShowAll=true, $iNumPage=false)
static GetNavParams ($nPageSize=0, $bShowAll=true, $iNumPage=false)

Защищенные статические члены

static cleanCache ()

Статические защищенные данные

static $cache = []

Дополнительные унаследованные члены

Поля данных унаследованные от CAllDBResult
 $result
 $arResult
 $arReplacedAliases
 $arResultAdd
 $bNavStart = false
 $bShowAll = false
 $NavNum
 $NavPageCount
 $NavPageNomer
 $NavPageSize
 $NavShowAll
 $NavRecordCount
 $bFirstPrintNav = true
 $PAGEN
 $SIZEN
 $SESS_SIZEN
 $SESS_ALL
 $SESS_PAGEN
 $add_anchor = ""
 $bPostNavigation = false
 $bFromArray = false
 $bFromLimited = false
 $nPageWindow = 5
 $nSelectedCount = false
 $arGetNextCache = false
 $bDescPageNumbering = false
 $arUserFields = false
 $usedUserFields = false
 $SqlTraceIndex = false
 $DB
 $NavRecordCountChangeDisable = false
 $is_filtered = false
 $nStartPage = 0
 $nEndPage = 0
 $resultObject = null
Защищенные члены унаследованные от CDBResult
 FetchRow ()
 GetRowsCount ()
 Seek (int $offset)
Защищенные члены унаследованные от CAllDBResult
 FetchInternal ()
 calculatePageNumber (int $defaultNumber=1, bool $useSession=true, bool $checkOutOfRange=false)
 AfterFetch (&$res)
Защищенные данные унаследованные от CDBResult
 $byteaFields = false

Подробное описание

См. определение в файле usertype.php строка 88

Методы

◆ Add()

Add ( $arFields,
$bCheckUserType = true )

Function to add a user property.

First, the instance method CheckFields is called (i.e., $this->CheckFields($arFields) ).

If the validation is successful, a check is performed to see if such a field already exists for the given entity.

Then, if necessary, tables of the form b_uts_[ENTITY_ID] and b_utm_[ENTITY_ID] are created.

After that, the metadata is saved in the database.

Only after this, the structure of the table b_uts_[ENTITY_ID] is modified.

Array arFields:

  • ENTITY_ID - entity
  • FIELD_NAME - the actual column name in the database where the property values will be stored.
  • USER_TYPE_ID - property type
  • XML_ID - identifier for use in import/export
  • SORT - sort order (default 100)
  • MULTIPLE - multiplicity flag Y/N (default N)
  • MANDATORY - mandatory value input flag Y/N (default N)
  • SHOW_FILTER - whether to show in the admin list filter and what type to use. see below.
  • SHOW_IN_LIST - whether to show in the admin list (default Y)
  • EDIT_IN_LIST - allow editing in forms, but not in API! (default Y)
  • IS_SEARCHABLE - field participates in search (default N)
  • SETTINGS - array with property settings dependent on the property type. They are "cleaned" through the type handler PrepareSettings.
  • EDIT_FORM_LABEL - array of language messages in the form array("ru"=>"привет", "en"=>"hello")
  • LIST_COLUMN_LABEL
  • LIST_FILTER_LABEL
  • ERROR_MESSAGE
  • HELP_MESSAGE

In case of an error, catch the application exception!

Values for SHOW_FILTER:

  • N - do not show
  • I - exact match
  • E - mask
  • S - substring
Аргументы
array$arFieldsMetadata of the new property
bool$bCheckUserType
Возвращает
integer - identifier of the added property, false - if the property was not added.

events PROVIDE_STORAGE - use own uf subsystem to store data (uts/utm tables)

См. определение в файле usertype.php строка 437

◆ CheckFields()

CheckFields ( $ID,
$arFields,
$bCheckUserType = true )

Function to validate metadata values of user properties.

Called in Add and Update methods to check the correctness of the entered values.

Validations:

  • ENTITY_ID - required
  • ENTITY_ID - no more than 50 characters
  • ENTITY_ID - must not contain any characters other than 0-9, A-Z, and _
  • FIELD_NAME - required
  • FIELD_NAME - at least 4 characters
  • FIELD_NAME - no more than 50 characters
  • FIELD_NAME - must not contain any characters other than 0-9, A-Z, and _
  • FIELD_NAME - must start with UF_
  • USER_TYPE_ID - required
  • USER_TYPE_ID - must be registered

In case of an error, catch the application exception!

Аргументы
integer$ID- property identifier. 0 - for new.
array$arFieldsProperty metadata
bool$bCheckUserType
Возвращает
boolean false - if any validation fails.

@global CUserTypeManager $USER_FIELD_MANAGER

См. определение в файле usertype.php строка 328

◆ cleanCache()

cleanCache ( )
staticprotected

См. определение в файле usertype.php строка 953

◆ CreatePropertyTables()

CreatePropertyTables ( $entity_id)

См. определение в файле usertype.php строка 92

◆ Delete()

Delete ( $ID)

Function to delete a user property and all its values.

First, the property metadata is deleted.

Then, all values of multiple properties are deleted from the table of the form b_utm_[ENTITY_ID].

After that, the column is dropped from the table of the form b_uts_[ENTITY_ID].

Аргументы
integer$IDProperty identifier
Возвращает
CDBResult | false - result of the last query executed by the function.

events PROVIDE_STORAGE - use own uf subsystem to store data (uts/utm tables)

См. определение в файле usertype.php строка 802

◆ DropEntity()

DropEntity ( $entity_id)

Function to delete ALL user properties of an entity.

First, the property metadata is deleted.

Can be called, for example, when deleting an infoblock.

Then, the tables of the form b_utm_[ENTITY_ID] and b_uts_[ENTITY_ID] are dropped.

Аргументы
string$entity_idEntity identifier
Возвращает
CDBResult - result of the last query executed by the function.

См. определение в файле usertype.php строка 909

◆ Fetch()

Fetch ( )

Fetch function.

Deserializes the SETTINGS field.

Возвращает
array Returns false in case of the last record in the selection.

Переопределяет метод предка CAllDBResult.

См. определение в файле usertype.php строка 973

◆ GetByID()

GetByID ( $ID)
static

Function to fetch metadata of a user property.

Returns an associative array of metadata that can be passed to Update.

Аргументы
integer$IDProperty identifier
Возвращает
array If the property is not found, false is returned

См. определение в файле usertype.php строка 130

◆ GetList()

GetList ( $aSort = [],
$aFilter = [] )
static

Function to fetch metadata of user properties.

Returns CDBResult - a selection based on filter and sorting.

The aSort parameter defaults to array("SORT"=>"ASC", "ID"=>"ASC").

If LANG is passed in aFilter, language messages are additionally selected.

Аргументы
array$aSortAssociative array for sorting (ID, ENTITY_ID, FIELD_NAME, SORT, USER_TYPE_ID)
array$aFilterAssociative array for filtering with strict matching (equals) (ID, ENTITY_ID, FIELD_NAME, USER_TYPE_ID, SORT, MULTIPLE, MANDATORY, SHOW_FILTER)
Возвращает
CDBResult

@noinspection PhpUndefinedVariableInspection

См. определение в файле usertype.php строка 170

◆ Update()

Update ( $ID,
$arFields )

Function to modify metadata of a user property.

It should be noted that for the sake of faster development, it was decided not to implement the same flexibility as in infoblocks (we will do without alters and other things for now).

First, the instance method CheckFields is called (i.e., $this->CheckFields($arFields) ).

After that, the metadata is saved in the database.

Array arFields (only what can be changed):

  • SORT - sort order
  • MANDATORY - mandatory value input flag Y/N
  • SHOW_FILTER - flag to show in the list filter Y/N
  • SHOW_IN_LIST - flag to show in the list Y/N
  • EDIT_IN_LIST - allow editing the field in admin forms or not Y/N
  • IS_SEARCHABLE - search flag Y/N
  • SETTINGS - array with property settings dependent on the property type. They are "cleaned" through the type handler PrepareSettings.
  • EDIT_FORM_LABEL - array of language messages in the form array("ru"=>"привет", "en"=>"hello")
  • LIST_COLUMN_LABEL
  • LIST_FILTER_LABEL
  • ERROR_MESSAGE
  • HELP_MESSAGE

In case of an error, catch the application exception!

Аргументы
integer$IDProperty identifier
array$arFieldsNew property metadata
Возвращает
boolean - true if the update is successful, false otherwise.

См. определение в файле usertype.php строка 659

Поля

◆ $cache

$cache = []
staticprotected

См. определение в файле usertype.php строка 90


Объявления и описания членов класса находятся в файле: