当前位置: 首页>>代码示例>>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;未经允许,请勿转载。