Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-32998 add warnings structure

  • Loading branch information...
commit 03d38b9207fa02592ccee9128eed828769f5ad56 1 parent 71d7bc3
@doraemonyoung doraemonyoung authored mouneyrac committed
Showing with 29 additions and 0 deletions.
  1. +29 −0 lib/externallib.php
View
29 lib/externallib.php
@@ -581,4 +581,33 @@ function external_delete_descriptions($component) {
"functionname IN (SELECT name FROM {external_functions} WHERE component = ?)", $params);
$DB->delete_records('external_services', array('component'=>$component));
$DB->delete_records('external_functions', array('component'=>$component));
+}
+
+/**
+ * Description of warning messages with external_multiple_structure.
+ *
+ * @package core_webservice
+ * @copyright 2012 Yang Yang
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ * @since Moodle 2.3
+ */
+class external_warnings {
+
+ /**
+ * Creates a warnings external_multiple_structure
+ *
+ * @return external_multiple_structure
+ * @since Moodle 2.3
+ */
+ public function warnings() {
+ return new external_multiple_structure(
+ new external_single_structure( array(
+ 'element' => new external_value(PARAM_TEXT, 'element'),
+ 'elementid' => new external_value(PARAM_INT, 'element id'),
+ 'warningcode' => new external_value(PARAM_ALPHANUM, 'the warning code can be used by
+ the client app to implement specific behaviour (e.g. "missingcourse")'),
+ 'message' => new external_value(PARAM_TEXT, 'untranslated english message to explain the warning')
+ ), 'warning'), 'list of warnings'
+ );
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.