1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Интерфейс ILearnLesson
Граф наследования:ILearnLesson:
CLearnLesson

Открытые статические члены

static Add ($arFields, $isCourse=false, $parentLessonId=true, $arProperties=array('SORT'=> 500))
static Update ($id, $arFields)
static Delete ($id)
static DeleteRecursiveLikeHardlinks ($id)
static GetByIDAsArr ($id)
static GetByID ($id)
static GetList ($arOrder=array(), $arFilter=array())
static GetListOfImmediateParents ($lessonId, $arOrder=array(), $arFilter=array(), $arSelectFields=array())
static GetListOfImmediateChilds ($lessonId, $arOrder=array(), $arFilter=array(), $arSelectFields=array())
static ListImmediateParents ($lessonId)
static ListImmediateChilds ($lessonId)
static ListImmediateNeighbours ($lessonId)
static GetLinkedCourse ($lessonId)
static GetTree ( $lessonId, $arOrder=array('EDGE_SORT'=> 'asc'), $arFilter=array(), $publishProhibitionMode=true)
static RelationAdd ($parentLessonId, $childLessonId, $arProperties)
static RelationUpdate ($parentLessonId, $childLessonId, $arProperties)
static RelationGet ($parentLessonId, $childLessonId)
static RelationRemove ($parentLessonId, $childLessonId)
static CountImmediateChilds ($lessonId)
static GetListOfParentPathes ($lessonId, $breakOnLessonId=false, $breakBeforeLessonId=false, $arIgnoreEdges=array())
static IsPublishProhibited ($lessonId, $contextCourseLessonId)
static PublishProhibitionSetTo ($lessonId, $contextCourseLessonId, $isProhibited)

Подробное описание

Note: usually in phpDoc blocks for methods listed not all exceptions, that can be throwed by them.

@access public

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

См. определение в файле clearnlesson.php строка 9

Методы

◆ Add()

Add ( $arFields,
$isCourse = false,
$parentLessonId = true,
$arProperties = array('SORT'=> 500) )
static

WARNING: second param ($isCourse) must be always set to FALSE, because it's is for internal use only. If you want to create course, use CCourse\Add instead.

Creates new lesson

WARNING: this method terminates (by die()/exit()) current execution flow when SQL server error occured. It's due to bug in CDatabase::Insert() in main module (version info: define("SM_VERSION","11.0.12"); define("SM_VERSION_DATE","2012-02-21 17:00:00"); // YYYY-MM-DD HH:MI:SS )

Аргументы
arrayof pairs field => value for new lesson. Allowed fields are ACTIVE, ACTIVE, true by default, available values are: true/false NAME, mustn't be omitted CODE, NULL by default PREVIEW_PICTURE, NULL by default, available value is array ('name' => ..., 'size' => ..., 'tmp_name' => ..., 'type' => ..., 'del' => ...) PREVIEW_TEXT, NULL by default PREVIEW_TEXT_TYPE, 'text' by default, available values are: 'text', 'html' DETAIL_PICTURE, NULL by default, available value is array ('name' => ..., 'size' => ..., 'tmp_name' => ..., 'type' => ..., 'del' => ...) DETAIL_TEXT, NULL by default DETAIL_TEXT_TYPE, 'text' by default, available values are: 'text', 'html', 'file' (filename in LAUNCH) LAUNCH, NULL by default
boolflag of course. If FALSE (default) lesson is not course, if TRUE created lesson will be the course (in this case arguments $parentLessonId and $arProperties are ignored, and $arFields can contain additional fields (any can be omitted):
  • SORT or COURSE_SORT: integer, 500 by default, sort order of courses. CORSE_SORT overrides SORT
  • ACTIVE_FROM: datetime, NULL by default
  • ACTIVE_TO: datetime, NULL by default
  • RATING: string (1 char): 'Y' / 'N' / NULL, 'N' by default
  • RATING_TYPE: string, allowed values: NULL, "like", "standart_text", "like_graphic", "standart", NULL by default
  • SCORM: string (1 char), 'N' by default ).
integer/boolid of immediate parent lesson. Default value is TRUE, what means "no immediate parent".
arrayof properties in relation to parent lesson: array ('SORT' => sort_order)
Исключения
LearnExceptionwith errcodes bit set (one of):
Возвращает
integer id of created lesson (if course was created, for get id of course method GetLinkedCourse() must be used)
Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ CountImmediateChilds()

CountImmediateChilds ( $lessonId)
static

Counts how much immediate childs given lesson has.

Аргументы
intid of lesson
Возвращает
int count of immediate childs for given lesson id.

Замещается в CLearnLesson.

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ Delete()

Delete ( $id)
static

Removes lesson and all relations from/to it.

Аргументы
integer/array.If not array => param interpreted as id of lesson to be removed. If array => param interpreted as array of params. Available params are:
  • 'lesson_id' - integer. Id of lesson to be removed.
  • 'simulate' - boolean, false by default. If true => nothing will be writed to DB.
  • 'check_permissions' - boolean, true by default
  • 'user_id' - integer. User_id for which permissions will be checked, -1 by default, which means 'current logged user' (it's means 'current user')
Исключения
LearnExceptionwith errcode bit set LearnException\EXC_ERR_GN_REMOVE, also errmsg === 'EA_NOT_EXISTS' if there is wasn't node with this id.

Замещается в CLearnLesson.

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ DeleteRecursiveLikeHardlinks()

DeleteRecursiveLikeHardlinks ( $id)
static

Detach the given lesson from all parents and recursively remove descendants, excepts descendants, that have ancestors outside of descendants of the given lesson. Such lessons will not be removed, but will be unlinked from lessons, which will be really removed.

Аргументы
integer/array.If not array => param interpreted as id of lesson to be removed. If array => param interpreted as array of params. Available params are:
  • 'lesson_id' - integer. Id of lesson to be removed.
  • 'simulate' - boolean, false by default. If true => nothing will be writed to DB.
  • 'check_permissions' - boolean, true by default
  • 'user_id' - integer. User_id for which permissions will be checked, -1 by default (it's means 'current user')

Замещается в CLearnLesson.

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ GetByID()

GetByID ( $id)
static
Исключения
LearnExceptionwith error bit set EXC_ERR_ALL_PARAMS
Возвращает
CDBResult

Замещается в CLearnLesson.

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ GetByIDAsArr()

GetByIDAsArr ( $id)
static

WARNING: don't use this function, it's for internal use only.

Аргументы
integerid of node to be getted
Исключения
LearnExceptionwith errcode bit set LearnException\EXC_ERR_GN_GETBYID. Messages can be: 'EA_PARAMS', 'EA_ACCESS_DENIED', 'EA_SQLERROR', 'EA_NOT_EXISTS'.

@access private

Возвращает
array of properties for node with $id

Замещается в CLearnLesson.

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ GetLinkedCourse()

GetLinkedCourse ( $lessonId)
static

Gets id of course corresponded to given lesson

Аргументы
integerid of lesson
Исключения
LearnExceptionwith error bit set (one of):
Возвращает
integer/bool id of linked (corresponded) course or FALSE if there is no course corresponded to the lesson.

Замещается в CLearnLesson.

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ GetList()

GetList ( $arOrder = array(),
$arFilter = array() )
static

◆ GetListOfImmediateChilds()

GetListOfImmediateChilds ( $lessonId,
$arOrder = array(),
$arFilter = array(),
$arSelectFields = array() )
static
Аргументы
intid of parent lesson
arrayorder (see format in comment for ThisClass::GetList())
arrayfilter (see format in comment for ThisClass::GetList())
arraylist of fields to be selected. If empty => selects all fields.
Исключения
LearnExceptionwith error bit set EXC_ERR_ALL_PARAMS
Возвращает
CDBResult each element contains EDGE_SORT - the sort index of LESSON_ID in relation to parent lesson given in first argument to this method.
Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ GetListOfImmediateParents()

GetListOfImmediateParents ( $lessonId,
$arOrder = array(),
$arFilter = array(),
$arSelectFields = array() )
static
Аргументы
intid of child lesson
arrayorder (see format in comment for ThisClass::GetList())
arrayfilter (see format in comment for ThisClass::GetList())
arraylist of fields to be selected. If empty => selects all fields.
Исключения
LearnExceptionwith error bit set EXC_ERR_ALL_PARAMS
Возвращает
CDBResult
Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ GetListOfParentPathes()

GetListOfParentPathes ( $lessonId,
$breakOnLessonId = false,
$breakBeforeLessonId = false,
$arIgnoreEdges = array() )
static

Lists all pathes to given lesson. Given lesson not included in pathes.

Аргументы
intlesson id to be started from
int/boolid of breakpoint-lesson (root lesson). It means, this lesson will be interpreted as parentless lesson. If param is false (it's by default) - than this argument will be ignored.
int/boolid of pre-breakpoint-lesson. It means, this lesson will not be included in pathes (all childs of this lesson will be interpreted as parentless lessons). If param is false (it's by default) - than this argument will be ignored.
arrayof edges to be ignored (interpreted as non-existing). array must be array of such arrays: ('PARENT_LESSON' => #id#, 'CHILD_LESSON' => #id#)
Возвращает
array of objects CLearnPath

Замещается в CLearnLesson.

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ GetTree()

GetTree ( $lessonId,
$arOrder = array('EDGE_SORT'=> 'asc'),
$arFilter = array(),
$publishProhibitionMode = true )
static

Build tree of lessons with the given root. WARNING: tree build algorithm skips duplicated lessons, so if there is some duplicates lessons, only one of them will be in resulted tree.

Аргументы
integerid of root lesson
arrayorder (by default: array('EDGE_SORT' => 'asc'))
arrayFilter for lessons
boolpublic prohibition mode flag. If set to TRUE, than all lessons (and they descendants) that are public prohibited in context of a course with lesson_id == $lessonId will be skipped during tree building.
Возвращает
object of type CLearnLessonTree
Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ IsPublishProhibited()

IsPublishProhibited ( $lessonId,
$contextCourseLessonId )
static

Checks for probition of publishing for given lesson in context of given course.

Аргументы
intlesson id to be checked for publish prohibition
intlesson id in context of which check. Must corresponds to course.
Возвращает
bool true - if lesson is prohibited to be published in this course, otherwise - false.

Замещается в CLearnLesson.

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ ListImmediateChilds()

ListImmediateChilds ( $lessonId)
static

Lists immediate childs.

Аргументы
integerid of lesson
Возвращает
array of immediate childs (empty array if there is no childs)
См. также
example for ListImmediateParents()

Замещается в CLearnLesson.

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ ListImmediateNeighbours()

ListImmediateNeighbours ( $lessonId)
static

Lists immediate neighbours.

Аргументы
integerid of lesson
Возвращает
array of immediate neighbours (empty array if there is no neighbours)
См. также
example for ListImmediateParents()

Замещается в CLearnLesson.

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ ListImmediateParents()

ListImmediateParents ( $lessonId)
static

◆ PublishProhibitionSetTo()

PublishProhibitionSetTo ( $lessonId,
$contextCourseLessonId,
$isProhibited )
static
Аргументы
intlesson id for publish (un)prohibition
intlesson id in context of which publish (un)prohibition will be done
boolif true - lesson will be prohibited for publish. If false - prohibition will be removed.
Возвращает
bool if true - prohibition status changed, false - otherwise. If status not changed - it isn't error, it means that status to be setted === status, that already set for lesson.

Замещается в CLearnLesson.

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ RelationAdd()

RelationAdd ( $parentLessonId,
$childLessonId,
$arProperties )
static

Link two lessons from $parentLessonId to $childLessonId

Аргументы
int$parentLessonId
int$childLessonId
arrayof properties of the link. Currently available properties:
  • 'SORT', integer All properties must be set.
Исключения
ExceptionLearnException with code error bit set LearnException\EXC_ERR_GR_LINK

Замещается в CLearnLesson.

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ RelationGet()

RelationGet ( $parentLessonId,
$childLessonId )
static

Get parametres of relation between two lessons

Аргументы
int$parentLessonId
int$childLessonId
Возвращает
array of properties of the link. Currently available properties:
  • 'SORT', integer
Исключения
ExceptionLearnException with code error bit set LearnException\EXC_ERR_GR_GET_PROPERTY

Замещается в CLearnLesson.

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ RelationRemove()

RelationRemove ( $parentLessonId,
$childLessonId )
static

Remove relation from $parentLessonId to $childLessonId

Аргументы
int$parentLessonId
int$childLessonId
Исключения
ExceptionLearnException with code error bit set LearnException\EXC_ERR_GR_UNLINK if relation isn't exists => message of exception === 'EA_NOT_EXISTS'

Замещается в CLearnLesson.

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ RelationUpdate()

RelationUpdate ( $parentLessonId,
$childLessonId,
$arProperties )
static

Update parametres of relation between two lessons

Аргументы
int$parentLessonId
int$childLessonId
arrayof properties of the link. Currently available properties:
  • 'SORT', integer
Исключения
ExceptionLearnException with code error bit set LearnException\EXC_ERR_GR_SET_PROPERTY

Замещается в CLearnLesson.

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

◆ Update()

Update ( $id,
$arFields )
static

Changes lesson's data

WARNING: this method terminates (by die()/exit()) current execution flow when SQL server error occured. It's due to bug in CDatabase::Update() in main module (version info: define("SM_VERSION","11.0.12"); define("SM_VERSION_DATE","2012-02-21 17:00:00"); // YYYY-MM-DD HH:MI:SS )

Аргументы
integerid of node to be updated
arrayof pairs field => value for lesson If lesson is the course, additional fields maybe set:
  • SORT or COURSE_SORT: integer, sort order of courses. CORSE_SORT overrides SORT
  • ACTIVE_FROM: datetime
  • ACTIVE_TO: datetime
  • RATING: string (1 char): 'Y' / 'N' / NULL
  • RATING_TYPE: string, allowed values: NULL, "like", "standart_text", "like_graphic", "standart"
  • SCORM: string (1 char) ).
Исключения
LearnExceptionwith errcodes bit set (one of):

Замещается в CLearnLesson.

Примеры
C:/bitrix/modules/learning/classes/general/clearnlesson.php.

Объявления и описания членов интерфейса находятся в файле: