当前位置: 首页>>代码示例>>PHP>>正文


PHP Subjects::find方法代码示例

本文整理汇总了PHP中Subjects::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Subjects::find方法的具体用法?PHP Subjects::find怎么用?PHP Subjects::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Subjects的用法示例。


在下文中一共展示了Subjects::find方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postAddTimeTablePeriods

 public function postAddTimeTablePeriods()
 {
     $period_id = Input::get('period_id');
     $class_id = Input::get('class_id');
     $day_id = Input::get('day_id');
     $section_id = Input::get('section_id');
     $subject_id = Input::get('subject_id');
     $teacher_id = Input::get('teacher_id');
     $timetable_period_id = Input::get('timetable_period_id');
     if ($timetable_period_id) {
         $timetable_period = Timetable::find($timetable_period_id);
     } else {
         $timetable_period = new Timetable();
     }
     $timetable_period->period_id = $period_id;
     $timetable_period->class_id = $class_id;
     $timetable_period->subject_id = $subject_id;
     $timetable_period->day_id = $day_id;
     $timetable_period->section_id = $section_id;
     $timetable_period->users_id = $teacher_id;
     $subject = Subjects::find($subject_id);
     $teacher = UserDetails::find($teacher_id);
     $period = Periods::find($period_id);
     if ($timetable_period->save()) {
         $response = array('status' => 'success', 'msg' => 'New Timetable period is saved, Successfully', 'result' => array('period' => $period, 'subject' => $subject, 'teacher' => $teacher, 'timetable_period' => $timetable_period));
         return Response::json($response);
     }
     $response = array('status' => 'failed', 'msg' => 'New Timetable period Couldnt be saved', 'result' => array('timetable_period' => 'none'));
     return Response::json($response);
 }
开发者ID:vivekjaiswal90,项目名称:schoolopedia,代码行数:30,代码来源:AdminTimeTableController.php


注:本文中的Subjects::find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。