- Модуль: learning
- Путь к файлу: ~/bitrix/modules/learning/classes/general/clearnlessontree.php
- Класс: CLearnLessonTree
- Вызов: CLearnLessonTree::__construct
public function __construct ($rootLessonId, $arOrder = null, $arFilter = array(), $publishProhibitionMode = true, $arSelectFields = array())
{
$this->EnsureStrictlyCastableToInt ($rootLessonId); // throws an exception on error
if ($arOrder === null)
$arOrder = array ('EDGE_SORT' => 'asc');
if (is_array($arSelectFields) && (count($arSelectFields) > 0))
{
$arFieldsMustBeSelected = array ('LESSON_ID', 'EDGE_SORT', 'IS_CHILDS');
foreach ($arFieldsMustBeSelected as $fieldName)
{
if ( ! in_array($fieldName, $arSelectFields) )
$arSelectFields[] = $fieldName;
}
}
$publishProhibitionContext = false;
if ($publishProhibitionMode)
{
$publishProhibitionContext = (int) $rootLessonId;
global $DB;
$rc = $DB->Query (
"SELECT PROHIBITED_LESSON_ID
FROM b_learn_publish_prohibition
WHERE COURSE_LESSON_ID = $publishProhibitionContext",
true // ignore errors
);
if ($rc === false)
throw new LearnException ('EA_SQLERROR', LearnException::EXC_ERR_ALL_GIVEUP);
while ($arData = $rc->Fetch())
$this->arPublishProhibitedLessons[] = (int) $arData['PROHIBITED_LESSON_ID'];
}
$arCurrentPath = array($rootLessonId);
$this->arTree = $this->BuildTreeRecursive(
$rootLessonId,
$arOrder,
$arFilter,
0,
NULL,
$arSelectFields,
$arCurrentPath
);
}