當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EfrontLesson::createInstance方法代碼示例

本文整理匯總了PHP中EfrontLesson::createInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP EfrontLesson::createInstance方法的具體用法?PHP EfrontLesson::createInstance怎麽用?PHP EfrontLesson::createInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在EfrontLesson的用法示例。


在下文中一共展示了EfrontLesson::createInstance方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUniqueLessonMode

 /**
  * Set the lesson mode to 'unique' in the course
  *
  * @param EfrontLesson $lesson The lesson to set the mode for
  * @since 3.6.1
  * @access private
  */
 private function setUniqueLessonMode($lesson)
 {
     $courseUsers = $this->countCourseUsers(array('archive' => false));
     if ($courseUsers['count'] > 0) {
         throw new Exception(_YOUCANNOTCHANGEMODECOURSENOTEMPTY, EfrontCourseException::COURSE_NOT_EMPTY);
     }
     //First, search for any instances that where already defined for this lesson and course in the past
     $result = eF_getTableData("lessons", "*", "instance_source=" . $lesson->lesson['id'] . " and originating_course=" . $this->course['id']);
     $coursedata = eF_getTableData("lessons_to_courses", "*", "lessons_ID=" . $lesson->lesson['id'] . " and courses_ID=" . $this->course['id']);
     if (sizeof($result) > 0) {
         $lessonInstance = new EfrontLesson($result[0]);
         $lessonsSchedule[$lessonInstance->lesson['id']] = array('start_date' => $coursedata[0]['start_date'], 'end_date' => $coursedata[0]['end_date'], 'start_period' => $coursedata[0]['start_period'], 'end_period' => $coursedata[0]['end_period']);
         $this->addLessons($lessonInstance, $lessonsSchedule);
     } else {
         $lessonInstance = EfrontLesson::createInstance($lesson, $this);
         $lessonsSchedule[$lessonInstance->lesson['id']] = array('start_date' => $coursedata[0]['start_date'], 'end_date' => $coursedata[0]['end_date'], 'start_period' => $coursedata[0]['start_period'], 'end_period' => $coursedata[0]['end_period']);
         $this->addLessons($lessonInstance, $lessonsSchedule);
     }
     $this->replaceLessonInCourseOrder($lesson, $lessonInstance);
     $this->replaceLessonInCourseRules($lesson, $lessonInstance);
     //Must be put *before* removeLessons()
     //$this -> removeLessons($lesson);		//commented out because it was messing up with order
     eF_deleteTableData("lessons_to_courses", "courses_ID=" . $this->course['id'] . " and lessons_ID=" . $lesson->lesson['id']);
 }
開發者ID:kaseya-university,項目名稱:efront,代碼行數:31,代碼來源:course.class.php


注:本文中的EfrontLesson::createInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。