/**
* Custom validation.
*
- * @throws coding_exception on error.
+ * @throws \coding_exception on error.
* @return void
*/
protected function validate_data() {
if (!$this->context->contextlevel === CONTEXT_MODULE) {
- throw new coding_exception('Content level must be CONTEXT_MODULE.');
+ throw new \coding_exception('Content level must be CONTEXT_MODULE.');
}
}
/**
* Validation that should be shared among child classes.
*
- * @throws coding_exception when validation fails.
+ * @throws \coding_exception when validation fails.
* @return void
*/
protected function validate_data() {
if (!$this->context->contextlevel === CONTEXT_MODULE) {
- throw new coding_exception('Content level must be CONTEXT_MODULE.');
+ throw new \coding_exception('Content level must be CONTEXT_MODULE.');
} else if (!isset($this->other['pathnamehashes']) || !is_array($this->other['pathnamehashes'])) {
- throw new coding_exception('pathnamehashes must be set in $other and must be an array.');
+ throw new \coding_exception('pathnamehashes must be set in $other and must be an array.');
} else if (!isset($this->other['content']) || !is_string($this->other['content'])) {
- throw new coding_exception('content must be set in $other and must be a string.');
+ throw new \coding_exception('content must be set in $other and must be a string.');
}
}
/**
* Custom validation.
*
- * @throws coding_exception
+ * @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['submission_editable'])) {
- throw new coding_exception('Other must contain the key submission_editable.');
+ throw new \coding_exception('Other must contain the key submission_editable.');
}
}
}
/**
* Custom validation
*
- * @throws coding_exception
+ * @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['triggeredfrom'])) {
- throw new coding_exception('triggeredfrom must be set in $other');
+ throw new \coding_exception('triggeredfrom must be set in $other');
}
}
}
/**
* Custom validation
*
- * @throws coding_exception
+ * @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['submission_editable'])) {
- throw new coding_exception('Other must contain the key submission_editable.');
+ throw new \coding_exception('Other must contain the key submission_editable.');
}
}
}
/**
* Custom validation.
*
- * @throws coding_exception
+ * @throws \coding_exception
* @return void
*/
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['discussionid'])) {
- throw new coding_exception('discussionid must be set in $other.');
+ throw new \coding_exception('discussionid must be set in $other.');
} else if (!isset($this->other['triggeredfrom'])) {
- throw new coding_exception('triggeredfrom must be set in $other');
+ throw new \coding_exception('triggeredfrom must be set in $other');
}
}
}