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


PHP Course::validateId方法代码示例

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


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

示例1: addCourse

 public static function addCourse($tutorId, $teachingCoursesId, $termId)
 {
     foreach ($teachingCoursesId as $courseId) {
         Course::validateId($courseId);
         if (Tutor::teachesCourseWithIdOnTerm($courseId, $tutorId, $termId)) {
             throw new Exception("Tutor already teaches a course with id {$courseId}");
         }
     }
     Term::validateId($termId);
     Tutor_has_course_has_schedule::addCourses($tutorId, $teachingCoursesId, $termId);
 }
开发者ID:sass-team,项目名称:sass-app,代码行数:11,代码来源:Tutor.class.php

示例2: validateCoursesId

 public static function validateCoursesId($coursesId)
 {
     foreach ($coursesId as $courseId) {
         Course::validateId($courseId);
     }
 }
开发者ID:sass-team,项目名称:sass-app,代码行数:6,代码来源:TutorHasCourseHasTerm.class.php

示例3: getTutorsOnTermOnCourse

 public static function getTutorsOnTermOnCourse($courseId, $termId)
 {
     Course::validateId($courseId);
     Term::validateId($termId);
     return ScheduleFetcher::retrieveTutorsOnTermOnCourse($courseId, $termId);
 }
开发者ID:sass-team,项目名称:sass-app,代码行数:6,代码来源:Schedule.class.php

示例4: getPendingAppointmentsWithCourseAndTutor

 public static function getPendingAppointmentsWithCourseAndTutor($tutorId, $courseId, $termId)
 {
     Course::validateId($courseId);
     Term::validateId($termId);
     $appointmentHours = AppointmentFetcher::getPendingAppointmentsWithCourseAndTutor($tutorId, $courseId, $termId);
     $appointmentHoursJSON = [];
     foreach ($appointmentHours as $appointmentHour) {
         $appointmentTitle = $appointmentHour[CourseFetcher::DB_COLUMN_CODE] . " - " . $appointmentHour[UserFetcher::DB_COLUMN_FIRST_NAME] . " " . $appointmentHour[UserFetcher::DB_COLUMN_LAST_NAME];
         $students = AppointmentHasStudentFetcher::retrieveStudentsWithAppointment($appointmentHour[AppointmentFetcher::DB_COLUMN_ID]);
         $appointmentTitle .= " - ";
         foreach ($students as $student) {
             $appointmentTitle .= $student[StudentFetcher::DB_TABLE . "_" . StudentFetcher::DB_COLUMN_FIRST_NAME] . " " . $student[StudentFetcher::DB_TABLE . "_" . StudentFetcher::DB_COLUMN_LAST_NAME] . ", ";
         }
         $appointmentTitle = rtrim($appointmentTitle, ", ");
         $startDate = new DateTime($appointmentHour[AppointmentFetcher::DB_COLUMN_START_TIME]);
         $endDate = new DateTime($appointmentHour[AppointmentFetcher::DB_COLUMN_END_TIME]);
         $appointmentUrl = App::getDomainName() . "/appointments/" . $appointmentHour[UserFetcher::DB_COLUMN_ID];
         switch ($appointmentHour[AppointmentFetcher::DB_COLUMN_LABEL_COLOR]) {
             case Appointment::LABEL_COLOR_PENDING:
                 $color = '#888888';
                 break;
             case Appointment::LABEL_COLOR_CANCELED:
                 $color = '#e5412d';
                 break;
             case Appointment::LABEL_COLOR_SUCCESS:
                 $color = '#3fa67a';
                 break;
             case Appointment::LABEL_COLOR_WARNING:
                 $color = '#f0ad4e';
                 break;
             default:
                 $color = '#444';
                 break;
         }
         $appointmentHoursJSON[] = ['title' => $appointmentTitle, 'start' => $startDate->format('Y-m-d H:i:s'), 'end' => $endDate->format('Y-m-d H:i:s'), 'allDay' => false, 'url' => $appointmentUrl, 'color' => $color];
     }
     return json_encode($appointmentHoursJSON);
 }
开发者ID:sass-team,项目名称:sass-app,代码行数:38,代码来源:Appointment.class.php


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