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


PHP grade_object::fetch_helper方法代码示例

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


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

示例1: fetch

 /**
  * Finds and returns a grade_category instance based on params.
  *
  * @param array $params associative arrays varname=>value
  * @return grade_category The retrieved grade_category instance or false if none found.
  */
 public static function fetch($params)
 {
     return grade_object::fetch_helper('grade_categories', 'grade_category', $params);
 }
开发者ID:covex-nn,项目名称:moodle,代码行数:10,代码来源:grade_category.php

示例2: fetch

 /**
  * Finds and returns a grade_scale instance based on params.
  * @static
  *
  * @param array $params associative arrays varname=>value
  * @return object grade_scale instance or false if none found.
  */
 function fetch($params)
 {
     return grade_object::fetch_helper('scale', 'grade_scale', $params);
 }
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:11,代码来源:grade_scale.php

示例3: fetch

 /**
  * Finds and returns a grade_outcome instance based on params.
  * @static
  *
  * @param array $params associative arrays varname=>value
  * @return object grade_outcome instance or false if none found.
  */
 function fetch($params)
 {
     return grade_object::fetch_helper('grade_outcomes', 'grade_outcome', $params);
 }
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:11,代码来源:grade_outcome.php

示例4: fetch

 /**
  * Finds and returns a grade_item instance based on params.
  * @static
  *
  * @param array $params associative arrays varname=>value
  * @return object grade_item instance or false if none found.
  */
 function fetch($params)
 {
     return grade_object::fetch_helper('grade_items', 'grade_item', $params);
 }
开发者ID:r007,项目名称:PMoodle,代码行数:11,代码来源:grade_item.php

示例5: backup_gradebook_item_info

function backup_gradebook_item_info($bf, $preferences, $backupall)
{
    global $CFG;
    require_once $CFG->libdir . '/gradelib.php';
    $status = true;
    // get all the grade_items, ordered by sort order since upon restoring, it is not always
    // possible to use the same sort order. We could at least preserve the sortorder by restoring
    // grade_items in the original sortorder
    if ($grade_items = get_records_sql("SELECT * FROM {$CFG->prefix}grade_items\n                                            WHERE courseid = {$preferences->backup_course}\n                                            ORDER BY sortorder ASC")) {
        //Begin grade_items tag
        fwrite($bf, start_tag("GRADE_ITEMS", 3, true));
        //Iterate for each item
        foreach ($grade_items as $grade_item) {
            // Instantiate a grade_item object, to access its methods
            $grade_item = grade_object::fetch_helper('grade_items', 'grade_item', $grade_item);
            // do not restore if this grade_item is a mod, and
            if ($grade_item->itemtype == 'mod') {
                // this still needs to be included, though grades can be ignored
            } else {
                if ($grade_item->itemtype == 'category') {
                    // if not all grade items are being backed up
                    // we ignore this type of grade_item and grades associated
                    if (!$backupall) {
                        continue;
                    }
                }
            }
            //Begin grade_item
            fwrite($bf, start_tag("GRADE_ITEM", 4, true));
            //Output individual fields
            fwrite($bf, full_tag("ID", 5, false, $grade_item->id));
            fwrite($bf, full_tag("CATEGORYID", 5, false, $grade_item->categoryid));
            fwrite($bf, full_tag("ITEMNAME", 5, false, $grade_item->itemname));
            fwrite($bf, full_tag("ITEMTYPE", 5, false, $grade_item->itemtype));
            fwrite($bf, full_tag("ITEMMODULE", 5, false, $grade_item->itemmodule));
            fwrite($bf, full_tag("ITEMINSTANCE", 5, false, $grade_item->iteminstance));
            fwrite($bf, full_tag("ITEMNUMBER", 5, false, $grade_item->itemnumber));
            fwrite($bf, full_tag("ITEMINFO", 5, false, $grade_item->iteminfo));
            fwrite($bf, full_tag("IDNUMBER", 5, false, $grade_item->idnumber));
            // use [idnumber] in calculation instead of [#giXXX#]
            fwrite($bf, full_tag("CALCULATION", 5, false, $grade_item->get_calculation()));
            fwrite($bf, full_tag("GRADETYPE", 5, false, $grade_item->gradetype));
            fwrite($bf, full_tag("GRADEMAX", 5, false, $grade_item->grademax));
            fwrite($bf, full_tag("GRADEMIN", 5, false, $grade_item->grademin));
            fwrite($bf, full_tag("SCALEID", 5, false, $grade_item->scaleid));
            fwrite($bf, full_tag("OUTCOMEID", 5, false, $grade_item->outcomeid));
            fwrite($bf, full_tag("GRADEPASS", 5, false, $grade_item->gradepass));
            fwrite($bf, full_tag("MULTFACTOR", 5, false, $grade_item->multfactor));
            fwrite($bf, full_tag("PLUSFACTOR", 5, false, $grade_item->plusfactor));
            fwrite($bf, full_tag("AGGREGATIONCOEF", 5, false, $grade_item->aggregationcoef));
            fwrite($bf, full_tag("DISPLAY", 5, false, $grade_item->plusfactor));
            fwrite($bf, full_tag("DECIMALS", 5, false, $grade_item->plusfactor));
            fwrite($bf, full_tag("HIDDEN", 5, false, $grade_item->hidden));
            fwrite($bf, full_tag("LOCKED", 5, false, $grade_item->locked));
            fwrite($bf, full_tag("LOCKTIME", 5, false, $grade_item->locktime));
            fwrite($bf, full_tag("NEEDSUPDATE", 5, false, $grade_item->needsupdate));
            fwrite($bf, full_tag("TIMECREATED", 5, false, $grade_item->timecreated));
            fwrite($bf, full_tag("TIMEMODIFIED", 5, false, $grade_item->timemodified));
            // back up the other stuff here
            // mod grades should only be backed up if selected
            if ($grade_item->itemtype == 'mod' && !backup_userdata_selected($preferences, $grade_item->itemmodule, $grade_item->iteminstance)) {
                // do not write grades if a mod grade_item is being restored
                // but userdata is not selected
            } else {
                $status = backup_gradebook_grades_info($bf, $preferences, $grade_item->id);
            }
            //End grade_item
            fwrite($bf, end_tag("GRADE_ITEM", 4, true));
        }
        //End grade_items tag
        $status = fwrite($bf, end_tag("GRADE_ITEMS", 3, true));
    }
    return $status;
}
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:74,代码来源:backuplib.php

示例6: fetch

 /**
  * Finds and returns a grade_category instance based on params.
  *
  * @param array $params associative arrays varname=>value
  * @return grade_category The retrieved grade_category instance or false if none found.
  */
 public static function fetch($params)
 {
     if ($records = self::retrieve_record_set($params)) {
         return reset($records);
     }
     $record = grade_object::fetch_helper('grade_categories', 'grade_category', $params);
     // We store it as an array to keep a key => result set interface in the cache, grade_object::fetch_helper is
     // managing exceptions. We return only the first element though.
     $records = false;
     if ($record) {
         $records = array($record->id => $record);
     }
     self::set_record_set($params, $records);
     return $record;
 }
开发者ID:rushi963,项目名称:moodle,代码行数:21,代码来源:grade_category.php


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