CCrmInstantEditorHelper::prepareRequisitesPresetList

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmInstantEditorHelper
  4. prepareRequisitesPresetList
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_component_helper.php
  • Класс: \CCrmInstantEditorHelper
  • Вызов: CCrmInstantEditorHelper::prepareRequisitesPresetList
static function prepareRequisitesPresetList($defaultPresetId): array
{
	$result = [];
	$propertyTypeByCountry = [];
	$list = EntityPreset::getListForRequisiteEntityEditor();
	foreach ($list as $item)
	{
		$countryId = (int)$item['COUNTRY_ID'];
		$preset = [
			'NAME' => $item['NAME'],
			'VALUE' => $item['ID'],
			'IS_DEFAULT' => ($defaultPresetId == $item['ID'])
		];
		if (!isset($propertyTypeByCountry[$countryId]))
		{
			$propertyValue = ClientResolver::getClientResolverPropertyWithPlacements($countryId);
			$propertyTypeByCountry[$countryId] = $propertyValue;
		}
		$preset['CLIENT_RESOLVER_PROP'] = $propertyTypeByCountry[$countryId];
		$result[] = $preset;
	}

	return $result;
}

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