100 if (!is_null($this->userFieldInfos))
102 return $this->userFieldInfos;
107 $userFieldsInfos = $this->getUfTypeManager()->GetUserFields(
112 foreach ($userFieldsInfos as $userFieldInfo)
114 $fieldName = $userFieldInfo[
'FIELD_NAME'];
116 'USER_TYPE_ID' => $userFieldInfo[
'USER_TYPE_ID'],
118 'ENTITY_VALUE_ID' => $this->getEntityId() ?? 0,
119 'FIELD' => $fieldName,
120 'MULTIPLE' => $userFieldInfo[
'MULTIPLE'],
121 'MANDATORY' => $userFieldInfo[
'MANDATORY'],
122 'SETTINGS' => $userFieldInfo[
'SETTINGS'] ??
null,
126 if ($fieldInfo[
'USER_TYPE_ID'] ===
'enumeration')
128 $fieldInfo[
'ENUM'] = [];
129 $enumDbResult = \CUserFieldEnum::GetList(
132 'USER_FIELD_ID' => $userFieldInfo[
'ID'],
135 while ($enum = $enumDbResult->Fetch())
137 $fieldInfo[
'ENUM'][] = [
139 'VALUE' => $enum[
'VALUE'],
144 $result[$fieldName] = [
145 'name' => $fieldName,
146 'title' => $userFieldInfo[
'EDIT_FORM_LABEL'] ?? $fieldName,
147 'type' =>
'userField',
148 'data' => [
'fieldInfo' => $fieldInfo],
149 'editable' => $userFieldInfo[
'EDIT_IN_LIST'] ===
'Y',
150 'required' => isset($userFieldInfo[
'MANDATORY']) && $userFieldInfo[
'MANDATORY'] ===
'Y',
154 $this->userFieldInfos = $result;
229 $this->getEntityId() ?? 0,
235 $userFieldValues = [];
236 foreach($userFields as $fieldName => $userField)
238 $fieldValue = $userField[
'VALUE'] ??
'';
239 $fieldData = $userFieldInfos[$fieldName] ??
null;
241 if (!is_array($fieldData))
246 $isEmptyField =
true;
247 $fieldParams = $fieldData[
'data'][
'fieldInfo'];
249 (is_string($fieldValue) && $fieldValue !==
'')
250 || (is_array($fieldValue) && !empty($fieldValue))
253 $fieldParams[
'VALUE'] = $fieldValue;
254 $isEmptyField =
false;
257 $fieldSignature = $this->getUfDispatcher()->getSignature($fieldParams);
260 $userFieldValues[$fieldName] = array(
261 'SIGNATURE' => $fieldSignature,
267 $userFieldValues[$fieldName] = array(
268 'VALUE' => $fieldValue,
269 'SIGNATURE' => $fieldSignature,
275 return $userFieldValues;