当前位置: 首页>>代码示例>>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;未经允许,请勿转载。