CBPVirtualDocument::getDocumentType

  1. Bitrix24 API (v. 23.675.0)
  2. bizproc
  3. CBPVirtualDocument
  4. getDocumentType
  • Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/virtualdocument.php
  • Класс: CBPVirtualDocument
  • Вызов: CBPVirtualDocument::getDocumentType
static function getDocumentType($documentId)
{
	if (mb_substr($documentId, 0, mb_strlen("type_")) == "type_")
		return $documentId;

	$documentId = intval($documentId);
	if ($documentId <= 0)
		throw new CBPArgumentNullException("documentId");

	$dbResult = CIBlockElement::GetList(array(), array("ID" => $documentId, "SHOW_NEW" => "Y"), false, false, array("ID", "IBLOCK_ID"));
	$arResult = $dbResult->Fetch();
	if (!$arResult)
		throw new Exception("Element is not found");

	return "type_".$arResult["IBLOCK_ID"];
}

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