本文整理汇总了PHP中Evaluation::set_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Evaluation::set_id方法的具体用法?PHP Evaluation::set_id怎么用?PHP Evaluation::set_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Evaluation
的用法示例。
在下文中一共展示了Evaluation::set_id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_evaluation
/**
* Lazy load function to get the linked evaluation
*/
protected function get_evaluation()
{
if (!isset($this->evaluation)) {
if (isset($this->ref_id)) {
$evalarray = Evaluation::load($this->get_ref_id());
$this->evaluation = $evalarray[0];
} else {
$eval = new Evaluation();
$eval->set_category_id(-1);
$eval->set_date(api_get_utc_datetime());
// these values will be changed
$eval->set_weight(0);
// when the link setter
$eval->set_visible(0);
// is called
$eval->set_id(-1);
// a 'real' id will be set when eval is added to db
$eval->set_user_id($this->get_user_id());
$eval->set_course_code($this->get_course_code());
$this->evaluation = $eval;
$this->set_ref_id($eval->get_id());
}
}
return $this->evaluation;
}
示例2: create_evaluation_objects_from_sql_result
/**
* @param array $result
* @return array
*/
private static function create_evaluation_objects_from_sql_result($result)
{
$alleval = array();
if (Database::num_rows($result)) {
while ($data = Database::fetch_array($result)) {
$eval = new Evaluation();
$eval->set_id($data['id']);
$eval->set_name($data['name']);
$eval->set_description($data['description']);
$eval->set_user_id($data['user_id']);
$eval->set_course_code($data['course_code']);
$eval->set_category_id($data['category_id']);
$eval->set_date(api_get_local_time($data['created_at']));
$eval->set_weight($data['weight']);
$eval->set_max($data['max']);
$eval->set_visible($data['visible']);
$eval->set_type($data['type']);
$eval->set_locked($data['locked']);
$eval->setSessionId(api_get_session_id());
$alleval[] = $eval;
}
}
return $alleval;
}
示例3: EvalForm
/**
* Script
* @package chamilo.gradebook
*/
require_once '../inc/global.inc.php';
api_block_anonymous_users();
GradebookUtils::block_students();
$evaledit = Evaluation::load($_GET['editeval']);
if ($evaledit[0]->is_locked() && !api_is_platform_admin()) {
api_not_allowed();
}
$form = new EvalForm(EvalForm::TYPE_EDIT, $evaledit[0], null, 'edit_eval_form', null, api_get_self() . '?editeval=' . Security::remove_XSS($_GET['editeval']));
if ($form->validate()) {
$values = $form->exportValues();
$eval = new Evaluation();
$eval->set_id($values['hid_id']);
$eval->set_name($values['name']);
$eval->set_description($values['description']);
$eval->set_user_id($values['hid_user_id']);
$eval->set_course_code($values['hid_course_code']);
$eval->set_category_id($values['hid_category_id']);
$parent_cat = Category::load($values['hid_category_id']);
$final_weight = $values['weight_mask'];
$eval->set_weight($final_weight);
$eval->set_max($values['max']);
if (empty($values['visible'])) {
$visible = 0;
} else {
$visible = 1;
}
$eval->set_visible($visible);