mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-18293 $DB->something is using exceptions, no need for ifs there, removing useless strings
This commit is contained in:
parent
7826abc79f
commit
2a7eff41ad
8 changed files with 30 additions and 59 deletions
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue