Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

   1  <?php
   2  // This file is part of Moodle - http://moodle.org/
   3  //
   4  // Moodle is free software: you can redistribute it and/or modify
   5  // it under the terms of the GNU General Public License as published by
   6  // the Free Software Foundation, either version 3 of the License, or
   7  // (at your option) any later version.
   8  //
   9  // Moodle is distributed in the hope that it will be useful,
  10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12  // GNU General Public License for more details.
  13  //
  14  // You should have received a copy of the GNU General Public License
  15  // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  16  
  17  /**
  18   * Database external functions and service definitions.
  19   *
  20   * @package    mod_data
  21   * @category   external
  22   * @copyright  2015 Juan Leyva <juan@moodle.com>
  23   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  24   * @since      Moodle 2.9
  25   */
  26  
  27  $functions = array(
  28  
  29      'mod_data_get_databases_by_courses' => array(
  30          'classname' => 'mod_data_external',
  31          'methodname' => 'get_databases_by_courses',
  32          'description' => 'Returns a list of database instances in a provided set of courses, if
  33              no courses are provided then all the database instances the user has access to will be returned.',
  34          'type' => 'read',
  35          'capabilities' => 'mod/data:viewentry',
  36          'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  37      ),
  38      'mod_data_view_database' => array(
  39          'classname'     => 'mod_data_external',
  40          'methodname'    => 'view_database',
  41          'description'   => 'Simulate the view.php web interface data: trigger events, completion, etc...',
  42          'type'          => 'write',
  43          'capabilities'  => 'mod/data:viewentry',
  44          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  45      ),
  46      'mod_data_get_data_access_information' => array(
  47          'classname'     => 'mod_data_external',
  48          'methodname'    => 'get_data_access_information',
  49          'description'   => 'Return access information for a given database.',
  50          'type'          => 'read',
  51          'capabilities'  => 'mod/data:viewentry',
  52          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  53      ),
  54      'mod_data_get_entries' => array(
  55          'classname'     => 'mod_data_external',
  56          'methodname'    => 'get_entries',
  57          'description'   => 'Return the complete list of entries of the given database.',
  58          'type'          => 'read',
  59          'capabilities'  => 'mod/data:viewentry',
  60          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  61      ),
  62      'mod_data_get_entry' => array(
  63          'classname'     => 'mod_data_external',
  64          'methodname'    => 'get_entry',
  65          'description'   => 'Return one entry record from the database, including contents optionally.',
  66          'type'          => 'read',
  67          'capabilities'  => 'mod/data:viewentry',
  68          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  69      ),
  70      'mod_data_get_fields' => array(
  71          'classname'     => 'mod_data_external',
  72          'methodname'    => 'get_fields',
  73          'description'   => 'Return the list of configured fields for the given database.',
  74          'type'          => 'read',
  75          'capabilities'  => 'mod/data:viewentry',
  76          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  77      ),
  78      'mod_data_search_entries' => array(
  79          'classname'     => 'mod_data_external',
  80          'methodname'    => 'search_entries',
  81          'description'   => 'Search for entries in the given database.',
  82          'type'          => 'read',
  83          'capabilities'  => 'mod/data:viewentry',
  84          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  85      ),
  86      'mod_data_approve_entry' => array(
  87          'classname'     => 'mod_data_external',
  88          'methodname'    => 'approve_entry',
  89          'description'   => 'Approves or unapproves an entry.',
  90          'type'          => 'write',
  91          'capabilities'  => 'mod/data:approve',
  92          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
  93      ),
  94      'mod_data_delete_entry' => array(
  95          'classname'     => 'mod_data_external',
  96          'methodname'    => 'delete_entry',
  97          'description'   => 'Deletes an entry.',
  98          'type'          => 'write',
  99          'capabilities'  => 'mod/data:manageentries',
 100          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
 101      ),
 102      'mod_data_add_entry' => array(
 103          'classname'     => 'mod_data_external',
 104          'methodname'    => 'add_entry',
 105          'description'   => 'Adds a new entry.',
 106          'type'          => 'write',
 107          'capabilities'  => 'mod/data:writeentry',
 108          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
 109      ),
 110      'mod_data_update_entry' => array(
 111          'classname'     => 'mod_data_external',
 112          'methodname'    => 'update_entry',
 113          'description'   => 'Updates an existing entry.',
 114          'type'          => 'write',
 115          'capabilities'  => 'mod/data:writeentry',
 116          'services'      => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
 117      ),
 118  );