MDL-18293 $DB->something is using exceptions, no need for ifs there, removing useless strings

This commit is contained in:
skodak 2009-06-03 20:37:28 +00:00
parent 7826abc79f
commit 2a7eff41ad
8 changed files with 30 additions and 59 deletions

View file

@ -203,9 +203,7 @@ abstract class grade_object {
$data = $this->get_record_data();
if (!$DB->update_record($this->table, $data)) {
return false;
}
$DB->update_record($this->table, $data);
if (empty($CFG->disablegradehistory)) {
unset($data->timecreated);
@ -290,10 +288,7 @@ abstract class grade_object {
$data = $this->get_record_data();
if (!$this->id = $DB->insert_record($this->table, $data)) {
debugging("Could not insert object into db");
return false;
}
$this->id = $DB->insert_record($this->table, $data);
// set all object properties from real db data
$this->update_from_db();

View file

@ -152,7 +152,7 @@ class grade_outcome extends grade_object {
$goc = new object();
$goc->courseid = $courseid;
$goc->outcomeid = $this->id;
return (bool)$DB->insert_record('grade_outcomes_courses', $goc);
$DB->insert_record('grade_outcomes_courses', $goc);
}
return true;
}