CCrmComponentHelper::PrepareExportFieldsList

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmComponentHelper
  4. PrepareExportFieldsList
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_component_helper.php
  • Класс: \CCrmComponentHelper
  • Вызов: CCrmComponentHelper::PrepareExportFieldsList
static function PrepareExportFieldsList(&$arSelect, $arFieldMap, $processMultiFields = true)
{
	if($processMultiFields)
	{
		$arMultiFieldTypes = CCrmFieldMulti::GetEntityTypes();
		foreach($arMultiFieldTypes as $typeID => &$arType)
		{
			if(isset($arFieldMap[$typeID]))
			{
				continue;
			}

			$arFieldMap[$typeID] = array();
			$arValueTypes = array_keys($arType);
			foreach($arValueTypes as $valueType)
			{
				$arFieldMap[$typeID][] = "{$typeID}_{$valueType}";
			}
		}
		unset($arType);
	}

	foreach($arFieldMap as $fieldID => &$arFieldReplace)
	{
		$offset = array_search($fieldID, $arSelect, true);
		if($offset === false)
		{
			continue;
		}

		array_splice(
			$arSelect,
			$offset,
			1,
			array_diff($arFieldReplace, $arSelect)
		);
	}
	unset($arFieldReplace);
}

Добавить комментарий