protected function validate_data() {
parent::validate_data();
- // TODO: MDL-45319 add validation of relateduserid and other['relateduserid'].
+ // TODO: MDL-45445 add validation of relateduserid and other['relateduserid'].
}
}
protected function get_legacy_logdata() {
return array(SITEID, 'user', 'add', '/view.php?id='.$this->objectid, fullname($this->get_legacy_eventdata()));
}
+
+ /**
+ * Custom validation.
+ *
+ * @throws \coding_exception
+ * @return void
+ */
+ protected function validate_data() {
+ parent::validate_data();
+
+ if (!isset($this->relateduserid)) {
+ debugging('The \'relateduserid\' value must be specified in the event.', DEBUG_DEVELOPER);
+ $this->relateduserid = $this->objectid;
+ }
+ }
}
protected function validate_data() {
parent::validate_data();
+ if (!isset($this->relateduserid)) {
+ debugging('The \'relateduserid\' value must be specified in the event.', DEBUG_DEVELOPER);
+ $this->relateduserid = $this->objectid;
+ }
+
if (!isset($this->other['username'])) {
throw new \coding_exception('The \'username\' value must be set in other.');
}
protected function get_legacy_logdata() {
return array(SITEID, 'user', 'update', 'view.php?id='.$this->objectid, '');
}
+
+ /**
+ * Custom validation.
+ *
+ * @throws \coding_exception
+ * @return void
+ */
+ protected function validate_data() {
+ parent::validate_data();
+
+ if (!isset($this->relateduserid)) {
+ debugging('The \'relateduserid\' value must be specified in the event.', DEBUG_DEVELOPER);
+ $this->relateduserid = $this->objectid;
+ }
+ }
}