• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/entitypreset.php
  • Класс: Bitrix\Crm\EntityPreset
  • Вызов: EntityPreset::getCountryCodeById
static function getCountryCodeById($countryId)
{
	$countryId = (int)$countryId;

	if (self::$countryCodes === null)
	{
		include($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/countries.php");
		/** @var array $arCounries */
		self::$countryCodes = array_flip($arCounries);
	}

	if(isset(self::$countryCodes[$countryId]))
		return self::$countryCodes[$countryId];

	return '';
}