• Модуль: lists
  • Путь к файлу: ~/bitrix/modules/lists/lib/entity/iblocktype.php
  • Класс: BitrixListsEntityIblockType
  • Вызов: IblockType::getIblockTypeId
public function getIblockTypeId()
{
	$this->param->checkRequiredInputParams(["IBLOCK_CODE", "IBLOCK_ID"]);
	if ($this->param->hasErrors())
	{
		$this->errorCollection->add($this->param->getErrors());
		return null;
	}

	$filter = ["CHECK_PERMISSIONS" => "Y"];

	if (empty($this->params["IBLOCK_ID"]))
	{
		$filter["=CODE"] = $this->params["IBLOCK_CODE"];
	}
	if (empty($this->params["IBLOCK_CODE"]))
	{
		$filter["=ID"] = $this->params["IBLOCK_ID"];
	}

	$queryObject = CIBlock::getList([], $filter);
	if ($iblock = $queryObject->fetch())
	{
		return ($iblock["IBLOCK_TYPE_ID"] ? $iblock["IBLOCK_TYPE_ID"] : null);
	}
	else
	{
		return null;
	}
}