1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Класс CLearnInstall201203ConvertDB

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

static run ()
static ConvertDB (&$errorMessage)
static _buildEdges (&$errorMessage)
static _MarkLessonAsProcessed ($lessonId)
static _CreateEdgeForNodes ($parentNodeId, $childNodeId, $sort)
static _GetChapterIdInNewDataModel ($b_learn_chapter_ID)
static _GetCourseIdInNewDataModel ($b_learn_course_ID)
static _processCourses ()
static avoidTimeout ()
static _processChapters ()
static _UnrepeatableCreateLesson ($arFields)
static _IsAlreadyConverted ()
static _CreateEdgesTbl ()
static _CreateFieldsInTbls ()
static _GiveUp ($msg=false)

Поля данных

const MODULE_ID = 'learning'
const OPTION_ID = '~LearnInstall201203ConvertDB::_IsAlreadyConverted'
const STATUS_INSTALL_COMPLETE = '1'
const STATUS_INSTALL_NEVER_START = '2'
const STATUS_INSTALL_INCOMPLETE = '3'
const JOURNAL_STATUS_UNPROCESSED = -1
const JOURNAL_STATUS_COURSE_LINKED = 1
const JOURNAL_STATUS_CHAPTER_COPIED = 2
const JOURNAL_STATUS_LESSON_EDGES_CREATED = 3

Статические открытые данные

static $items_processed = 0

Защищенные статические члены

static StartTransaction ()
static Rollback ()
static Commit ()
static ReCreateTriggersForMSSQL ()
static _RightsModelGetTasksWithOperations ()
static _RightsModelGetAllOperations ()
static _CheckOperationsInDB ()
static _CheckTasksInDB ($arTasksOperations)
static _CheckTasksOperationsRelations ($arOperationsInDB, $arTasksInDB, $arTasksOperations)
static IsNewRightsModelInitialized (&$step, &$msg)
static _RightsModelCreateOperations ()
static _RightsModelCreateTasksAndRelation ($arOperationsInDB)
static _RightsModelPurge ()
static InitializeNewRightsModel ()
static _CreateTblRightsAll ()
static ConvertPermissions ()
static AddPath ()
static _RemoveOrphanedTables ()

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

См. определение в файле converter_to_11.5.0.php строка 12

Методы

◆ _buildEdges()

_buildEdges ( & $errorMessage)
static
Возвращает
int items processed

An error occured (chapter or course not found in new data model) In old data model, this shouldn't be. So, it's may be: 1) our bug during importing chapter/courses to lessons 2) data inconsistency in target database 3) third-party UPDATE/INSERT/DELETE was processed on lessons/chapters/courses during convertation In any case, this situation is not good (except, probabaly, case #2). But, best we can do is continue convertation. Because, if we restart convertation, it can be infinitly looped.

So, nothing to do here.

См. определение в файле converter_to_11.5.0.php строка 774

◆ _CheckOperationsInDB()

_CheckOperationsInDB ( )
staticprotected
Возвращает
array of operations with IDs

См. определение в файле converter_to_11.5.0.php строка 208

◆ _CheckTasksInDB()

_CheckTasksInDB ( $arTasksOperations)
staticprotected

См. определение в файле converter_to_11.5.0.php строка 246

◆ _CheckTasksOperationsRelations()

_CheckTasksOperationsRelations ( $arOperationsInDB,
$arTasksInDB,
$arTasksOperations )
staticprotected

См. определение в файле converter_to_11.5.0.php строка 287

◆ _CreateEdgeForNodes()

_CreateEdgeForNodes ( $parentNodeId,
$childNodeId,
$sort )
static

См. определение в файле converter_to_11.5.0.php строка 895

◆ _CreateEdgesTbl()

_CreateEdgesTbl ( )
static

См. определение в файле converter_to_11.5.0.php строка 1262

◆ _CreateFieldsInTbls()

_CreateFieldsInTbls ( )
static

См. определение в файле converter_to_11.5.0.php строка 1282

◆ _CreateTblRightsAll()

_CreateTblRightsAll ( )
staticprotected

См. определение в файле converter_to_11.5.0.php строка 541

◆ _GetChapterIdInNewDataModel()

_GetChapterIdInNewDataModel ( $b_learn_chapter_ID)
static
Аргументы
intchapter_id in old data model (in table b_learn_chapter)
Возвращает
int chapter_id in new data model (in table b_learn_lesson) OR -1 on error

См. определение в файле converter_to_11.5.0.php строка 926

◆ _GetCourseIdInNewDataModel()

_GetCourseIdInNewDataModel ( $b_learn_course_ID)
static
Аргументы
intcourse_id in old data model (in table b_learn_course)
Возвращает
int course_id in new data model (in table b_learn_lesson) OR -1 on error

См. определение в файле converter_to_11.5.0.php строка 948

◆ _GiveUp()

_GiveUp ( $msg = false)
static

См. определение в файле converter_to_11.5.0.php строка 1439

◆ _IsAlreadyConverted()

_IsAlreadyConverted ( )
static

We are converted if option with name self::OPTION_ID is set to self::STATUS_INSTALL_COMPLETE

!!! But, if: 1) this option is set to self::STATUS_INSTALL_NEVER_START AND 2) there is tables b_learn_lesson_edges exists & b_learn_rights_all and b_learn_course_permission doesn't exists it means that options is incorrectly set (or was reseted by somebody else), so we returns that DB is already converted

См. определение в файле converter_to_11.5.0.php строка 1218

◆ _MarkLessonAsProcessed()

_MarkLessonAsProcessed ( $lessonId)
static

См. определение в файле converter_to_11.5.0.php строка 877

◆ _processChapters()

_processChapters ( )
static

См. определение в файле converter_to_11.5.0.php строка 1088

◆ _processCourses()

_processCourses ( )
static
Возвращает
int items processed

См. определение в файле converter_to_11.5.0.php строка 969

◆ _RemoveOrphanedTables()

_RemoveOrphanedTables ( )
staticprotected

См. определение в файле converter_to_11.5.0.php строка 1250

◆ _RightsModelCreateOperations()

_RightsModelCreateOperations ( )
staticprotected

См. определение в файле converter_to_11.5.0.php строка 355

◆ _RightsModelCreateTasksAndRelation()

_RightsModelCreateTasksAndRelation ( $arOperationsInDB)
staticprotected

См. определение в файле converter_to_11.5.0.php строка 396

◆ _RightsModelGetAllOperations()

_RightsModelGetAllOperations ( )
staticprotected

См. определение в файле converter_to_11.5.0.php строка 187

◆ _RightsModelGetTasksWithOperations()

_RightsModelGetTasksWithOperations ( )
staticprotected

См. определение в файле converter_to_11.5.0.php строка 114

◆ _RightsModelPurge()

_RightsModelPurge ( )
staticprotected

См. определение в файле converter_to_11.5.0.php строка 500

◆ _UnrepeatableCreateLesson()

_UnrepeatableCreateLesson ( $arFields)
static

Inserts new lesson to b_learn_lesson. Before insert, drop exists lessons with such WAS_CHAPTER_ID (if not NULL) or with such WAS_COURSE_ID (if not NULL)

См. определение в файле converter_to_11.5.0.php строка 1163

◆ AddPath()

AddPath ( )
staticprotected

См. определение в файле converter_to_11.5.0.php строка 716

◆ avoidTimeout()

avoidTimeout ( )
static

This function throws exception CLearnInstall201203ConvertDBTimeOut, if it's low time left.

Hmmm... WTF?! Lets think, that our limit is 25 seconds. If it actually less, there is nothing wrong, because current algorithm should be firm to breaks in any place.

We have unlimited time, but some troubles can occur in IIS, so limit time to 20 seconds.

См. определение в файле converter_to_11.5.0.php строка 1037

◆ Commit()

Commit ( )
staticprotected

См. определение в файле converter_to_11.5.0.php строка 101

◆ ConvertDB()

ConvertDB ( & $errorMessage)
static
Возвращает
int items processed

Our plan: 1) Create lesson for every course and links them (b_learn_course.LINKED_LESSON_ID = id_of_new_lesson). Than update b_learn_course.JOURNAL_STATUS to self::JOURNAL_STATUS_COURSE_LINKED

2) Copy all chapters to lessons table and than update b_learn_chapter.JOURNAL_STATUS = self::JOURNAL_STATUS_CHAPTER_COPIED

3) Build all edges between lessons. Firstly, build edges for simple lessons (not that was a chapter or course), and than for lessons-chapters.

См. определение в файле converter_to_11.5.0.php строка 565

◆ ConvertPermissions()

ConvertPermissions ( )
staticprotected

См. определение в файле converter_to_11.5.0.php строка 627

◆ InitializeNewRightsModel()

InitializeNewRightsModel ( )
staticprotected

См. определение в файле converter_to_11.5.0.php строка 525

◆ IsNewRightsModelInitialized()

IsNewRightsModelInitialized ( & $step,
& $msg )
staticprotected

См. определение в файле converter_to_11.5.0.php строка 330

◆ ReCreateTriggersForMSSQL()

ReCreateTriggersForMSSQL ( )
staticprotected

См. определение в файле converter_to_11.5.0.php строка 109

◆ Rollback()

Rollback ( )
staticprotected

См. определение в файле converter_to_11.5.0.php строка 93

◆ run()

run ( )
static

См. определение в файле converter_to_11.5.0.php строка 28

◆ StartTransaction()

StartTransaction ( )
staticprotected

См. определение в файле converter_to_11.5.0.php строка 85

Поля

◆ $items_processed

$items_processed = 0
static

См. определение в файле converter_to_11.5.0.php строка 25

◆ JOURNAL_STATUS_CHAPTER_COPIED

const JOURNAL_STATUS_CHAPTER_COPIED = 2

См. определение в файле converter_to_11.5.0.php строка 22

◆ JOURNAL_STATUS_COURSE_LINKED

const JOURNAL_STATUS_COURSE_LINKED = 1

См. определение в файле converter_to_11.5.0.php строка 21

◆ JOURNAL_STATUS_LESSON_EDGES_CREATED

const JOURNAL_STATUS_LESSON_EDGES_CREATED = 3

См. определение в файле converter_to_11.5.0.php строка 23

◆ JOURNAL_STATUS_UNPROCESSED

const JOURNAL_STATUS_UNPROCESSED = -1

См. определение в файле converter_to_11.5.0.php строка 20

◆ MODULE_ID

const MODULE_ID = 'learning'

См. определение в файле converter_to_11.5.0.php строка 14

◆ OPTION_ID

const OPTION_ID = '~LearnInstall201203ConvertDB::_IsAlreadyConverted'

См. определение в файле converter_to_11.5.0.php строка 15

◆ STATUS_INSTALL_COMPLETE

const STATUS_INSTALL_COMPLETE = '1'

См. определение в файле converter_to_11.5.0.php строка 16

◆ STATUS_INSTALL_INCOMPLETE

const STATUS_INSTALL_INCOMPLETE = '3'

См. определение в файле converter_to_11.5.0.php строка 18

◆ STATUS_INSTALL_NEVER_START

const STATUS_INSTALL_NEVER_START = '2'

См. определение в файле converter_to_11.5.0.php строка 17


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