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


PHP Course::order_by_related方法代碼示例

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


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

示例1: get_table_content

 public function get_table_content()
 {
     $fields_config = array(array('name' => 'created', 'caption' => 'lang:common_table_header_created'), array('name' => 'updated', 'caption' => 'lang:common_table_header_updated'), array('name' => 'name', 'caption' => 'lang:admin_courses_table_header_course_name'), array('name' => 'description', 'caption' => 'lang:admin_courses_table_header_course_description'), array('name' => 'period', 'caption' => 'lang:admin_courses_table_header_course_period'), array('name' => 'groups', 'caption' => 'lang:admin_courses_table_header_course_groups'), array('name' => 'task_set_types', 'caption' => 'lang:admin_courses_table_header_course_task_set_types'), array('name' => 'task_set_count', 'caption' => 'lang:admin_courses_table_header_course_task_set_count'), array('name' => 'capacity', 'caption' => 'lang:admin_courses_table_header_course_capacity'));
     $filter = $this->input->post('filter');
     $this->store_filter($filter);
     $this->inject_stored_filter();
     $courses = new Course();
     $courses->include_related_count('group');
     $courses->include_related_count('task_set_type');
     $courses->include_related_count('task_set');
     $courses->include_related('period', 'name', TRUE);
     $order_by_direction = $filter['order_by_direction'] == 'desc' ? 'desc' : 'asc';
     if ($filter['order_by_field'] == 'name') {
         $courses->order_by_with_constant('name', $order_by_direction);
     } elseif ($filter['order_by_field'] == 'period') {
         $courses->order_by_related('period', 'sorting', $order_by_direction);
     } elseif ($filter['order_by_field'] == 'created') {
         $courses->order_by('created', $order_by_direction);
     } elseif ($filter['order_by_field'] == 'updated') {
         $courses->order_by('updated', $order_by_direction);
     } elseif ($filter['order_by_field'] == 'groups') {
         $courses->order_by('group_count', $order_by_direction);
     } elseif ($filter['order_by_field'] == 'task_set_types') {
         $courses->order_by('task_set_type_count', $order_by_direction);
     } elseif ($filter['order_by_field'] == 'task_set_count') {
         $courses->order_by('task_set_count', $order_by_direction);
     } elseif ($filter['order_by_field'] == 'capacity') {
         $courses->order_by('capacity', $order_by_direction);
     }
     $courses->get_iterated();
     $this->lang->init_overlays('courses', $courses->all_to_array(), array('description'));
     $this->parser->parse('backend/courses/table_content.tpl', array('courses' => $courses, 'fields_config' => $fields_config));
 }
開發者ID:andrejjursa,項目名稱:list-lms,代碼行數:33,代碼來源:courses.php

示例2: preConfigureForm

 public function preConfigureForm()
 {
     $courses = new Course();
     $courses->include_related('period');
     $courses->order_by_related('period', 'sorting', 'asc');
     $courses->order_by_with_constant('name');
     $courses->get_iterated();
     $courses_list = array('' => '');
     foreach ($courses as $course) {
         $courses_list[$this->lang->text($course->period_name)][$course->id] = $this->lang->text($course->name);
     }
     $this->parser->assign('courses', $courses_list);
 }
開發者ID:andrejjursa,項目名稱:list-lms,代碼行數:13,代碼來源:unevaluated_solutions.php

示例3: _init_teacher_quick_prefered_course_menu

 protected function _init_teacher_quick_prefered_course_menu()
 {
     $menu = array();
     $courses = new Course();
     $courses->include_related('period', 'name');
     $courses->order_by_related('period', 'sorting', 'asc');
     $courses->order_by_with_constant('name', 'asc');
     $courses->get_iterated();
     foreach ($courses as $course) {
         $menu[$course->period_name][$course->id] = $course->name;
     }
     $teacher = new Teacher();
     $teacher->get_by_id($this->usermanager->get_teacher_id());
     $current_course_name = $this->lang->line('admin_teachers_no_prefered_course');
     $current_course_id = NULL;
     if ($teacher->exists()) {
         $prefered_course = $teacher->prefered_course->get();
         if ($prefered_course->exists()) {
             $current_course_name = $this->lang->text($prefered_course->name);
             $current_course_id = $prefered_course->id;
         }
     }
     $this->parser->assign('list_teacher_prefered_course_name', $current_course_name);
     $this->parser->assign('list_teacher_prefered_course_id', $current_course_id);
     $this->parser->assign('list_teacher_prefered_course_menu', $menu);
 }
開發者ID:andrejjursa,項目名稱:list-lms,代碼行數:26,代碼來源:LIST_Controller.php

示例4: inject_courses

 private function inject_courses()
 {
     $courses = new Course();
     $courses->include_related('period', 'name');
     $courses->order_by_related('period', 'sorting', 'ASC');
     $courses->order_by_with_constant('name', 'ASC');
     $courses->get_iterated();
     $this->parser->assign('courses', $courses);
 }
開發者ID:andrejjursa,項目名稱:list-lms,代碼行數:9,代碼來源:tasks.php

示例5: inject_courses

 private function inject_courses()
 {
     $courses = new Course();
     $courses->include_related('period', 'name');
     $courses->order_by_related('period', 'sorting', 'asc');
     $courses->order_by_with_constant('name', 'asc');
     $courses->get_iterated();
     $data = array('' => '');
     foreach ($courses as $course) {
         $data[$course->period_name][$course->id] = $course->name;
     }
     $this->parser->assign('courses', $data);
 }
開發者ID:andrejjursa,項目名稱:list-lms,代碼行數:13,代碼來源:teachers.php


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