MDL-45445 events: added missing 'relateduserid' validation

This commit is contained in:
Mark Nelson
2014-06-12 20:47:20 -07:00
parent 7f75f1507e
commit 655cdde2dc
30 changed files with 313 additions and 5 deletions
+14
View File
@@ -92,4 +92,18 @@ class note_updated extends base {
$logurl->set_anchor('note-' . $this->objectid);
return array($this->courseid, 'notes', 'update', $logurl, 'update note');
}
/**
* Custom validation.
*
* @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->relateduserid)) {
throw new \coding_exception('The \'relateduserid\' must be set.');
}
}
}