當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。