3namespace Bitrix\Catalog\RestView;
5use Bitrix\Catalog\Document\StoreDocumentTableManager;
7use Bitrix\Rest\Integration\View\Attributes;
8use Bitrix\Rest\Integration\View\DataType;
9use Bitrix\Rest\Integration\View\Base;
17 'TYPE' => DataType::TYPE_INT,
18 'CANONICAL_NAME' =>
'ID',
21 'TYPE' => DataType::TYPE_CHAR,
25 'CANONICAL_NAME' =>
'DOC_TYPE',
32 $documentType =
$fields[
'DOCUMENT_TYPE'];
33 $fieldsInfo = array_merge($fieldsInfo, $this->
getFields(), $this->getFieldMapForType($documentType));
35 return parent::internalizeFieldsUpdate(
$fields, $fieldsInfo);
40 $documentType = $arguments[
'filter'][
'DOCUMENT_TYPE'] ??
null;
41 $allowUserFields = (is_string($documentType) && $documentType !==
'');
42 $fieldsInfo = array_merge(
45 $allowUserFields ? $this->getFieldMapForType($documentType) : []
48 return parent::internalizeFieldsList($arguments, $fieldsInfo);
53 $isDynamic = in_array(Attributes::DYNAMIC,
$info[
'ATTRIBUTES'],
true);
54 $isMultiple = in_array(Attributes::MULTIPLE,
$info[
'ATTRIBUTES'],
true);
55 if (empty($value) && $isDynamic && $isMultiple)
60 if ((
$info[
'USER_FIELD_TYPE'] ??
null) ===
'file')
64 $internalizedValue = [];
65 foreach ($value as $item)
67 $internalizedValue[] = $this->internalizeFileValue($item);
69 $value = $internalizedValue;
73 $value = $this->internalizeFileValue($value);
77 return parent::internalizeExtendedTypeValue($value,
$info);
82 $documentType =
$fields[
'DOC_TYPE'];
83 $fieldsInfo = array_merge($fieldsInfo, $this->
getFields(), $this->getFieldMapForType($documentType));
85 return parent::externalizeFieldsGet(
$fields, $fieldsInfo);
90 $documentType = $list[0][
'DOC_TYPE'] ??
null;
92 $documentType !==
null
93 ? $this->getFieldMapForType($documentType)
96 $fieldsInfo = array_merge($fieldsInfo, $this->
getFields(), $userFields);
98 return parent::externalizeListFields($list, $fieldsInfo);
101 private function getFieldMapForType($documentType):
array
105 if (!(is_string($documentType) && $documentType !==
''))
110 $ufEntityId = StoreDocumentTableManager::getUfEntityIds()[$documentType] ??
'';
119 foreach ($userFieldsDescriptions as $userField)
121 $attributes = [Attributes::DYNAMIC];
122 if ($userField[
'MULTIPLE'] ===
'Y')
124 $attributes[] = Attributes::MULTIPLE;
126 $result[
'FIELD_' . $userField[
'ID']] = [
127 'ATTRIBUTES' => $attributes,
128 'CANONICAL_NAME' => $userField[
'FIELD_NAME'],
129 'USER_FIELD_TYPE' => $userField[
'USER_TYPE_ID']
internalizeFieldsList($arguments, $fieldsInfo=[])
externalizeFieldsGet($fields, $fieldsInfo=[])
internalizeFieldsUpdate($fields, $fieldsInfo=[])
externalizeListFields($list, $fieldsInfo=[])
internalizeExtendedTypeValue($value, $info)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
global $USER_FIELD_MANAGER
if($NS['step']==6) if( $NS[ 'step']==7) if(COption::GetOptionInt('main', 'disk_space', 0) > 0) $info