• Модуль: learning
  • Путь к файлу: ~/bitrix/modules/learning/classes/general/clearnlesson.php
  • Класс: CLearnLesson
  • Вызов: CLearnLesson::IsPublishProhibited
static function IsPublishProhibited ($in_lessonId, $in_contextCourseLessonId)
{
	global $DB;

	self::_EnsureArgsStrictlyCastableToIntegers ($in_lessonId, $in_contextCourseLessonId);
	$lessonId              = (int) $in_lessonId;
	$contextCourseLessonId = (int) $in_contextCourseLessonId;

	$rc = $DB->Query (
		"SELECT COURSE_LESSON_ID
		FROM b_learn_publish_prohibition
		WHERE COURSE_LESSON_ID = $contextCourseLessonId
			AND PROHIBITED_LESSON_ID = $lessonId
		",
		true	// ignore errors
		);

	if ($rc === false)
		throw new LearnException ('EA_SQLERROR', LearnException::EXC_ERR_ALL_GIVEUP);

	$arData = $rc->Fetch();
	if ($arData === false)
		return (false);		// lesson isn't prohibited for publish under given course

	return (true);		// lesson is prohibited for publish
}