Moodle  2.2.1
http://www.collinsharper.com
external_api Class Reference
Inheritance diagram for external_api:

Static Public Member Functions

static set_context_restriction ($context)
static set_timeout ($seconds=360)
static validate_parameters (external_description $description, $params)
static clean_returnvalue (external_description $description, $response)

Static Protected Member Functions

static validate_context ($context)

Detailed Description

Base class for external api methods.

Definition at line 116 of file externallib.php.


Member Function Documentation

static clean_returnvalue ( external_description description,
response 
) [static]

Clean response If a response attribute is unknown from the description, we just ignore the attribute. If a response attribute is incorrect, invalid_response_exception is thrown. Note: this function is similar to validate parameters, however it is distinct because parameters validation must be distinct from cleaning return values.

Parameters:
external_description$descriptiondescription of the return values
mixed$responsethe actual response
Returns:
mixed response with added defaults for optional items, invalid_response_exception thrown if any problem found

Definition at line 227 of file externallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static set_context_restriction ( context) [static]

Set context restriction for all following subsequent function calls.

Parameters:
stdClass$contex
Returns:
void

Definition at line 124 of file externallib.php.

Here is the caller graph for this function:

static set_timeout ( seconds = 360) [static]

This method has to be called before every operation that takes a longer time to finish!

Parameters:
int$secondsmax expected time the next operation needs
Returns:
void

Definition at line 135 of file externallib.php.

Here is the caller graph for this function:

static validate_context ( context) [static, protected]

Makes sure user may execute functions in this context.

Parameters:
object$context
Returns:
void

Definition at line 303 of file externallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static validate_parameters ( external_description description,
params 
) [static]

Validates submitted function parameters, if anything is incorrect invalid_parameter_exception is thrown. This is a simple recursive method which is intended to be called from each implementation method of external API.

Parameters:
external_description$descriptiondescription of parameters
mixed$paramsthe actual parameters
Returns:
mixed params with added defaults for optional items, invalid_parameters_exception thrown if any problem found

Definition at line 149 of file externallib.php.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations