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

	if ($presetId > 0)
	{
		$preset = EntityPreset::getSingleInstance();
		$res = $preset->getList(
			[
				'filter' => array(
					'=ENTITY_TYPE_ID' => EntityPreset::Requisite,
					'=ID' => $presetId
				),
				'select' => ['COUNTRY_ID'],
				'limit' => 1
			]
		);
		if (($row = $res->fetch()) && isset($row['COUNTRY_ID']))
		{
			$countryId = (int)$row['COUNTRY_ID'];
		}
	}

	return $countryId;
}