24 abstract public function getUfEntityId(): string;
41 private function getUfTypeManager(): CUserTypeManager
43 return UserFieldHelper::getInstance()->getManager();
55 $fields = parent::getFields();
70 $fields[
'ENABLE_USER_FIELD_CREATION'] =
true;
71 $fields[
'ENABLE_USER_FIELD_MANDATORY_CONTROL'] =
true;
72 $fields[
'USER_FIELD_ENTITY_ID'] = $this->getUfEntityId();
73 $fields[
'USER_FIELD_PREFIX'] = $this->getUfEntityId();
74 $fields[
'USER_FIELD_CREATE_SIGNATURE'] = $this->getUfDispatcher()->getCreateSignature([
75 'ENTITY_ID' => $this->getUfEntityId(),
77 $fields[
'USER_FIELD_CREATE_PAGE_URL'] =
null;
93 $userFieldsInfos = $this->getUfTypeManager()->GetUserFields(
94 $this->getUfEntityId(),
98 foreach ($userFieldsInfos as $userFieldInfo)
100 $fieldName = $userFieldInfo[
'FIELD_NAME'];
102 'name' => $fieldName,
103 'title' => $userFieldInfo[
'EDIT_FORM_LABEL'] ?? $fieldName,
104 'type' =>
'userField',
107 'USER_TYPE_ID' => $userFieldInfo[
'USER_TYPE_ID'],
108 'ENTITY_ID' => $this->getUfEntityId(),
109 'ENTITY_VALUE_ID' => $this->getEntityId(),
110 'FIELD' => $fieldName,
111 'MULTIPLE' => $userFieldInfo[
'MULTIPLE'],
112 'MANDATORY' => $userFieldInfo[
'MANDATORY'],
113 'SETTINGS' => $userFieldInfo[
'SETTINGS'] ??
null,
131 $fieldInfo = $field[
'data'][
'fieldInfo'];
132 $fieldName = $fieldInfo[
'FIELD'] ??
null;
139 $value = $this->getUfTypeManager()->GetUserFieldValue(
140 $this->getUfEntityId(),
148 $fieldInfo[
'VALUE'] = $value;
151 $userFieldDispatcher = \Bitrix\Main\UserField\Dispatcher::instance();
152 $signatire = $userFieldDispatcher->getSignature($fieldInfo);
158 'SIGNATURE' => $signatire,
165 'SIGNATURE' => $signatire,
224 foreach ($ufFields as $item)
226 $fieldName = $item[
'name'];
fillUfEntityData(array $entityData)
trait ProviderWithUserFieldsTrait
fillUfEntityFields(array $fields)
getUfEntityDataValue(array $field)