• Модуль: learning
  • Путь к файлу: ~/bitrix/modules/learning/classes/general/course.php
  • Класс: CCourse
  • Вызов: CCourse::GetSiteId
static function GetSiteId($COURSE_ID)
{
	global $DB;
	$strSql = "SELECT SITE_ID FROM b_learn_course_site WHERE COURSE_ID=" . ((int) $COURSE_ID);

	$rc = $DB->Query($strSql, true);
	if ($rc === false)
		throw new LearnException ('EA_SQLERROR', LearnException::EXC_ERR_ALL_GIVEUP);

	$row = $rc->Fetch();
	if ( ! isset($row['SITE_ID']) )
		throw new LearnException ('EA_NOT_EXISTS', LearnException::EXC_ERR_ALL_NOT_EXISTS);

	return ($row['SITE_ID']);
}