• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/classes/general/cml2.php
  • Класс: CUserCMLImport
  • Вызов: CUserCMLImport::GetSectionByXML_ID
function GetSectionByXML_ID($IBLOCK_ID, $XML_ID)
{
	if (!is_array($this->arSectionCache))
		$this->arSectionCache = array();

	if(!array_key_exists($IBLOCK_ID, $this->arSectionCache))
		$this->arSectionCache[$IBLOCK_ID] = array();
	if(!array_key_exists($XML_ID, $this->arSectionCache[$IBLOCK_ID]))
	{
		if (null == $this->__ibs)
			$this->__ibs = new CIBlockSection;

		$rsSection = $this->__ibs->GetList(array(), array("IBLOCK_ID"=>$IBLOCK_ID, "EXTERNAL_ID"=>$XML_ID), false);

		if($arSection = $rsSection->Fetch())
		{
			$this->arSectionCache[$IBLOCK_ID][$XML_ID] = $arSection["ID"];
		}
		else
			$this->arSectionCache[$IBLOCK_ID][$XML_ID] = false;
	}

	return $this->arSectionCache[$IBLOCK_ID][$XML_ID];
}