• Модуль: learning
  • Путь к файлу: ~/bitrix/modules/learning/lib/integration/search.php
  • Класс: BitrixLearningIntegrationSearch
  • Вызов: Search::getLessonCourseId
static function getLessonCourseId($lessonId)
{
	$ids = [];
	$paths = CLearnLesson::getListOfParentPathes($lessonId);

	foreach ($paths as $path)
	{
		$parentLessons = $path->getPathAsArray();
		foreach ($parentLessons as $parentLessonId)
		{
			$linkedCourseId = CLearnLesson::getLinkedCourse($parentLessonId);
			if (
				$linkedCourseId !== false &&
				$linkedCourseId > 0 &&
				!CLearnLesson::isPublishProhibited($lessonId, $parentLessonId)
			)
			{
				$ids[] = $linkedCourseId;
			}
		}
	}

	return $ids;
}