2 // This file is part of Moodle - http://moodle.org/
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.
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.
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/>.
18 * Database external functions and service definitions.
22 * @copyright 2015 Juan Leyva <juan@moodle.com>
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
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.',
35 'capabilities' => 'mod/data:viewentry',
36 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE
)
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...',
43 'capabilities' => 'mod/data:viewentry',
44 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE
)
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.',
51 'capabilities' => 'mod/data:viewentry',
52 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE
)
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.',
59 'capabilities' => 'mod/data:viewentry',
60 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE
)
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.',
67 'capabilities' => 'mod/data:viewentry',
68 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE
)
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.',
75 'capabilities' => 'mod/data:viewentry',
76 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE
)
78 'mod_data_search_entries' => array(
79 'classname' => 'mod_data_external',
80 'methodname' => 'search_entries',
81 'description' => 'Search for entries in the given database.',
83 'capabilities' => 'mod/data:viewentry',
84 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE
)
86 'mod_data_approve_entry' => array(
87 'classname' => 'mod_data_external',
88 'methodname' => 'approve_entry',
89 'description' => 'Approves or unapproves an entry.',
91 'capabilities' => 'mod/data:approve',
92 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE
)
94 'mod_data_delete_entry' => array(
95 'classname' => 'mod_data_external',
96 'methodname' => 'delete_entry',
97 'description' => 'Deletes an entry.',
99 'capabilities' => 'mod/data:manageentries',
100 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE
)
102 'mod_data_add_entry' => array(
103 'classname' => 'mod_data_external',
104 'methodname' => 'add_entry',
105 'description' => 'Adds a new entry.',
107 'capabilities' => 'mod/data:writeentry',
108 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE
)
110 'mod_data_update_entry' => array(
111 'classname' => 'mod_data_external',
112 'methodname' => 'update_entry',
113 'description' => 'Updates an existing entry.',
115 'capabilities' => 'mod/data:writeentry',
116 'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE
)
118 'mod_data_delete_saved_preset' => array(
119 'classname' => 'mod_data\external\delete_saved_preset',
120 'description' => 'Delete site user preset.',
123 'capabilities' => 'mod/data:manageuserpresets',
125 'mod_data_get_mapping_information' => array(
126 'classname' => 'mod_data\external\get_mapping_information',
127 'description' => 'Get importing information',
130 'capabilities' => 'mod/data:managetemplates',