本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}