Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
mod_data_external Class Reference

Database module external functions. More...

Inheritance diagram for mod_data_external:

Static Public Member Functions

static add_entry ($databaseid, $groupid, $data)
 Adds a new entry to a database.
 
static add_entry_parameters ()
 Returns description of method parameters.
 
static add_entry_returns ()
 Returns description of method result value.
 
static approve_entry ($entryid, $approve=true)
 Approves or unapproves an entry.
 
static approve_entry_parameters ()
 Returns description of method parameters.
 
static approve_entry_returns ()
 Returns description of method result value.
 
static delete_entry ($entryid)
 Deletes an entry.
 
static delete_entry_parameters ()
 Returns description of method parameters.
 
static delete_entry_returns ()
 Returns description of method result value.
 
static get_data_access_information ($databaseid, $groupid=0)
 Return access information for a given database.
 
static get_data_access_information_parameters ()
 Returns description of method parameters.
 
static get_data_access_information_returns ()
 Returns description of method result value.
 
static get_databases_by_courses ($courseids=array())
 Returns a list of databases in a provided list of courses, if no list is provided all databases that the user can view will be returned.
 
static get_databases_by_courses_parameters ()
 Describes the parameters for get_databases_by_courses.
 
static get_databases_by_courses_returns ()
 Describes the get_databases_by_courses return value.
 
static get_entries ($databaseid, $groupid=0, $returncontents=false, $sort=null, $order=null, $page=0, $perpage=0)
 Return access information for a given feedback.
 
static get_entries_parameters ()
 Returns description of method parameters.
 
static get_entries_returns ()
 Returns description of method result value.
 
static get_entry ($entryid, $returncontents=false)
 Return one entry record from the database, including contents optionally.
 
static get_entry_parameters ()
 Returns description of method parameters.
 
static get_entry_returns ()
 Returns description of method result value.
 
static get_fields ($databaseid)
 Return the list of configured fields for the given database.
 
static get_fields_parameters ()
 Returns description of method parameters.
 
static get_fields_returns ()
 Returns description of method result value.
 
static search_entries ($databaseid, $groupid=0, $returncontents=false, $search='', $advsearch=[], $sort=null, $order=null, $page=0, $perpage=0)
 Return access information for a given feedback.
 
static search_entries_parameters ()
 Returns description of method parameters.
 
static search_entries_returns ()
 Returns description of method result value.
 
static update_entry ($entryid, $data)
 Updates an existing entry.
 
static update_entry_parameters ()
 Returns description of method parameters.
 
static update_entry_returns ()
 Returns description of method result value.
 
static view_database ($databaseid)
 Simulate the data/view.php web interface page: trigger events, completion, etc...
 
static view_database_parameters ()
 Returns description of method parameters.
 
static view_database_returns ()
 Returns description of method result value.
 

Static Protected Member Functions

static validate_database ($databaseid)
 Utility function for validating a database.
 

Detailed Description

Database module external functions.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Since
Moodle 2.9

Member Function Documentation

◆ add_entry()

static mod_data_external::add_entry ( $databaseid,
$groupid,
$data )
static

Adds a new entry to a database.

Parameters
int$databaseidthe data instance id
int$groupid(optional) group id, 0 means that the function will determine the user group
array$datathe fields data to be created
Return values
arrayof warnings and status result
Since
Moodle 3.3
Exceptions
moodle_exception

◆ add_entry_parameters()

static mod_data_external::add_entry_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.3

◆ add_entry_returns()

static mod_data_external::add_entry_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.3

◆ approve_entry()

static mod_data_external::approve_entry ( $entryid,
$approve = true )
static

Approves or unapproves an entry.

Parameters
int$entryidthe record entry id id
bool$approvewhether to approve (true) or unapprove the entry
Return values
arrayof warnings and the entries
Since
Moodle 3.3
Exceptions
moodle_exception

◆ approve_entry_parameters()

static mod_data_external::approve_entry_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.3

◆ approve_entry_returns()

static mod_data_external::approve_entry_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.3

◆ delete_entry()

static mod_data_external::delete_entry ( $entryid)
static

Deletes an entry.

Parameters
int$entryidthe record entry id
Return values
arrayof warnings success status
Since
Moodle 3.3
Exceptions
moodle_exception

◆ delete_entry_parameters()

static mod_data_external::delete_entry_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.3

◆ delete_entry_returns()

static mod_data_external::delete_entry_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.3

◆ get_data_access_information()

static mod_data_external::get_data_access_information ( $databaseid,
$groupid = 0 )
static

Return access information for a given database.

Parameters
int$databaseidthe database instance id
int$groupid(optional) group id, 0 means that the function will determine the user group
Return values
arrayof warnings and access information
Since
Moodle 3.3
Exceptions
moodle_exception

◆ get_data_access_information_parameters()

static mod_data_external::get_data_access_information_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.3

◆ get_data_access_information_returns()

static mod_data_external::get_data_access_information_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.3

◆ get_databases_by_courses()

static mod_data_external::get_databases_by_courses ( $courseids = array())
static

Returns a list of databases in a provided list of courses, if no list is provided all databases that the user can view will be returned.

Parameters
array$courseidsthe course ids
Return values
arraythe database details
Since
Moodle 2.9

◆ get_databases_by_courses_parameters()

static mod_data_external::get_databases_by_courses_parameters ( )
static

Describes the parameters for get_databases_by_courses.

Return values
external_function_parameters
Since
Moodle 2.9

◆ get_databases_by_courses_returns()

static mod_data_external::get_databases_by_courses_returns ( )
static

Describes the get_databases_by_courses return value.

Return values
external_single_structure
Since
Moodle 2.9

◆ get_entries()

static mod_data_external::get_entries ( $databaseid,
$groupid = 0,
$returncontents = false,
$sort = null,
$order = null,
$page = 0,
$perpage = 0 )
static

Return access information for a given feedback.

Parameters
int$databaseidthe data instance id
int$groupid(optional) group id, 0 means that the function will determine the user group
bool$returncontentsWhether to return the entries contents or not
str$sortsort by this field
int$orderthe direction of the sorting
int$pagepage of records to return
int$perpagenumber of records to return per page
Return values
arrayof warnings and the entries
Since
Moodle 3.3
Exceptions
moodle_exception

◆ get_entries_parameters()

static mod_data_external::get_entries_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.3

◆ get_entries_returns()

static mod_data_external::get_entries_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.3

◆ get_entry()

static mod_data_external::get_entry ( $entryid,
$returncontents = false )
static

Return one entry record from the database, including contents optionally.

Parameters
int$entryidthe record entry id id
bool$returncontentswhether to return the entries contents or not
Return values
arrayof warnings and the entries
Since
Moodle 3.3
Exceptions
moodle_exception

◆ get_entry_parameters()

static mod_data_external::get_entry_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.3

◆ get_entry_returns()

static mod_data_external::get_entry_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.3

◆ get_fields()

static mod_data_external::get_fields ( $databaseid)
static

Return the list of configured fields for the given database.

Parameters
int$databaseidthe database id
Return values
arrayof warnings and the fields
Since
Moodle 3.3
Exceptions
moodle_exception

◆ get_fields_parameters()

static mod_data_external::get_fields_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.3

◆ get_fields_returns()

static mod_data_external::get_fields_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.3

◆ search_entries()

static mod_data_external::search_entries ( $databaseid,
$groupid = 0,
$returncontents = false,
$search = '',
$advsearch = [],
$sort = null,
$order = null,
$page = 0,
$perpage = 0 )
static

Return access information for a given feedback.

Parameters
int$databaseidthe data instance id
int$groupid(optional) group id, 0 means that the function will determine the user group
bool$returncontentswhether to return contents or not
str$searchsearch text
array$advsearchadvanced search data
str$sortsort by this field
int$orderthe direction of the sorting
int$pagepage of records to return
int$perpagenumber of records to return per page
Return values
arrayof warnings and the entries
Since
Moodle 3.3
Exceptions
moodle_exception

◆ search_entries_parameters()

static mod_data_external::search_entries_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.3

◆ search_entries_returns()

static mod_data_external::search_entries_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.3

◆ update_entry()

static mod_data_external::update_entry ( $entryid,
$data )
static

Updates an existing entry.

Parameters
int$entryidthe data instance id
array$datathe fields data to be created
Return values
arrayof warnings and status result
Since
Moodle 3.3
Exceptions
moodle_exception

◆ update_entry_parameters()

static mod_data_external::update_entry_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.3

◆ update_entry_returns()

static mod_data_external::update_entry_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.3

◆ validate_database()

static mod_data_external::validate_database ( $databaseid)
staticprotected

Utility function for validating a database.

Parameters
int$databaseiddatabase instance id
Return values
arrayarray containing the database object, course, context and course module objects
Since
Moodle 3.3

◆ view_database()

static mod_data_external::view_database ( $databaseid)
static

Simulate the data/view.php web interface page: trigger events, completion, etc...

Parameters
int$databaseidthe data instance id
Return values
arrayof warnings and status result
Since
Moodle 3.3
Exceptions
moodle_exception

◆ view_database_parameters()

static mod_data_external::view_database_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.3

◆ view_database_returns()

static mod_data_external::view_database_returns ( )
static

Returns description of method result value.

Return values
core_external\external_description
Since
Moodle 3.3

The documentation for this class was generated from the following file: