15 private array $userField;
20 parent::__construct();
22 $fieldInfo =
$options[
'fieldInfo'] ?? [];
26 || !is_array($fieldInfo)
27 || empty($fieldInfo[
'ENTITY_ID'])
28 || empty($fieldInfo[
'FIELD'])
34 if (!$this->validateSignature($fieldInfo))
39 $this->userField = $this->loadUserField($fieldInfo);
40 if (empty($this->userField))
46 private function validateSignature(array $fieldInfo): bool
48 $signature = $fieldInfo[
'SIGNATURE'] ??
'';
54 private function loadUserField(array $fieldInfo): array
56 $userFieldResult = \CUserTypeEntity::GetList([], [
57 'ENTITY_ID' => $fieldInfo[
'ENTITY_ID'],
58 'FIELD_NAME' => $fieldInfo[
'FIELD'],
61 return $userFieldResult->Fetch();
66 return $this->userField;
75 if (!$USER->isAuthorized())
83 private function getEnumList(): array
89 foreach ($this->list as $id => $name)
105 if ($this->list ===
null)
110 $this->list = $userField[
'USER_TYPE'][
'FIELDS'];
123 foreach ($this->getEnumList() as $userFieldItem)
125 $result[] = $this->
makeItem($userFieldItem);
146 foreach ($this->getEnumList() as $item)
159 'title' => $item[
'NAME'],
static validateSignature(SignatureManager $signatureManager, array $fieldParam, $signature)