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


PHP Course::fetch方法代碼示例

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


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

示例1: fetchcourse

 function fetchcourse($code)
 {
     $code = Course::code_normalize($code);
     if (isset($coursecache[$code])) {
         return $coursecache[$code];
     }
     return $coursecache[$code] = Course::fetch($code);
 }
開發者ID:mattmaynes2,項目名稱:Coursinator,代碼行數:8,代碼來源:courseofferings.php

示例2: array_push

Goal is to find 5 courses that they haven't taken, and for which they have satisfied the prerequisites
Electives count as one course found, these are added to a list of electives but not scheduled
Courses for which the prerequisites are satisfied but are not immediately considered for scheduling are added to a list of alternatives
This algorithm also attempts to schedule concurrent prerequisites together
*/
for ($i = 0; $i < count($pattern); $i++) {
    if ($found == 5) {
        break;
    }
    if ($pattern[$i][1] != '0') {
        array_push($electives, $pattern[$i]);
        $found++;
        continue;
    }
    $course = Course::fetch($pattern[$i][0]);
    if (count($course->unsatisfied_prerequisites($completed_as_courses, $scheduling)) == 0) {
        array_push($scheduling, $course);
        $found++;
    } else {
        array_push($discarded, $course);
        continue;
    }
    //Check and see if we can fit the discarded courses in now
    foreach ($discarded as $key => $tryagain) {
        if (isset($tryagain)) {
            if (count($tryagain->unsatisfied_prerequisites($completed_as_courses, $scheduling)) == 0) {
                array_push($scheduling, $tryagain);
                $found++;
                unset($discarded[$key]);
            }
開發者ID:mattmaynes2,項目名稱:Coursinator,代碼行數:30,代碼來源:coursesuggestions.php

示例3: WebPage

<?php

session_start();
define("CONST_FILE_PATH", "../includes/constants.php");
include '../classes/WebPage.php';
//Set up page as a web page
$thisPage = new WebPage();
//Create new instance of webPage class
$dbObj = new Database();
//Instantiate database
$courseObj = new Course($dbObj);
// Create an object of Course class
$errorArr = array();
//Array of errors
//fetch all courses
header('Content-type: application/json');
echo $courseObj->fetch();
開發者ID:Mojolagbe2014,項目名稱:mojoimipakiti,代碼行數:17,代碼來源:fetch-courses.php


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