Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-32998 add warnings structure

  • Loading branch information...
commit 03d38b9207fa02592ccee9128eed828769f5ad56 1 parent 71d7bc3
Yang authored May 15, 2012 mouneyrac committed May 15, 2012

Showing 1 changed file with 29 additions and 0 deletions. Show diff stats Hide diff stats

  1. 29  lib/externallib.php
29  lib/externallib.php
@@ -581,4 +581,33 @@ function external_delete_descriptions($component) {
581 581
             "functionname IN (SELECT name FROM {external_functions} WHERE component = ?)", $params);
582 582
     $DB->delete_records('external_services', array('component'=>$component));
583 583
     $DB->delete_records('external_functions', array('component'=>$component));
  584
+}
  585
+
  586
+/**
  587
+ * Description of warning messages with external_multiple_structure.
  588
+ *
  589
+ * @package    core_webservice
  590
+ * @copyright  2012 Yang Yang
  591
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  592
+ * @since  Moodle 2.3
  593
+ */
  594
+class external_warnings {
  595
+
  596
+    /**
  597
+     * Creates a warnings external_multiple_structure
  598
+     *
  599
+     * @return external_multiple_structure
  600
+     * @since  Moodle 2.3
  601
+     */
  602
+    public function warnings() {
  603
+        return new external_multiple_structure(
  604
+            new external_single_structure( array(
  605
+                    'element'   => new external_value(PARAM_TEXT, 'element'),
  606
+                    'elementid' => new external_value(PARAM_INT, 'element id'),
  607
+                    'warningcode' => new external_value(PARAM_ALPHANUM, 'the warning code can be used by
  608
+                               the client app to implement specific behaviour (e.g. "missingcourse")'),
  609
+                    'message' => new external_value(PARAM_TEXT, 'untranslated english message to explain the warning')
  610
+                ), 'warning'), 'list of warnings'
  611
+        );
  612
+    }
584 613
 }

0 notes on commit 03d38b9

Please sign in to comment.
Something went wrong with that request. Please try again.