Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
XMLDBAction Class Reference

Main xmldb action clasee. More...

Inheritance diagram for XMLDBAction:

Public Member Functions

 __construct ()
 Constructor.
 
 getDoesGenerate ()
 Returns the type of output of the file.
 
 getError ()
 getError method, returns the last error string.
 
 getOutput ()
 getOutput method, returns the output generated by the action.
 
 getPostAction ()
 getPostAction method, returns the action to launch after executing another one
 
 getTitle ()
 getTitle method returns the title of the action (that is part of the $str array attribute
 
 init ()
 Init method, every subclass will have its own, always calling the parent one.
 
 invoke ()
 main invoke method, it sets the postaction attribute if possible and checks sesskey_protected if needed
 
 launch ($action)
 launch method, used to easily call invoke methods between actions
 
 loadStrings ($strings)
 loadStrings method, loads the required strings specified in the array parameter
 
 upgrade_savepoint_php ($structure)
 This function will generate the PHP code needed to implement the upgrade_xxxx_savepoint() php calls in upgrade code generated from the editor.
 

Protected Attributes

bool $can_subaction
 Set own core attributes.
 
bool $does_generate
 Type of value returned by the invoke method, ACTION_GENERATE_HTML have contents to show, set by each specialized invoke.
 
string $errormsg
 Last Error produced.
 
string $output
 Output of the action, set by each specialized invoke, get with getOutput.
 
string $postaction
 Action to execute at the end of the invoke script.
 
bool $sesskey_protected
 Actions must be protected by sesskey mechanism.
 
string $str
 Strings used by the action set by each specialized init, calling loadStrings.
 
mixed $subaction
 
string $title
 Title of the Action (class name, by default), set by parent init automatically.
 

Detailed Description

Main xmldb action clasee.

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

Main xmldb action class. It implements all the basic functionalities to be shared by each action.

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

Member Function Documentation

◆ getDoesGenerate()

XMLDBAction::getDoesGenerate ( )

Returns the type of output of the file.

Return values
bool

◆ getError()

XMLDBAction::getError ( )

getError method, returns the last error string.

Used if the invoke() methods returns false

Return values
string

◆ getOutput()

XMLDBAction::getOutput ( )

getOutput method, returns the output generated by the action.

Used after execution of the invoke() methods if they return true

Return values
string

◆ getPostAction()

XMLDBAction::getPostAction ( )

getPostAction method, returns the action to launch after executing another one

Return values
string

◆ getTitle()

XMLDBAction::getTitle ( )

getTitle method returns the title of the action (that is part of the $str array attribute

Return values
string

Reimplemented in add_persistent_mandatory.

◆ init()

◆ invoke()

◆ launch()

XMLDBAction::launch ( $action)

launch method, used to easily call invoke methods between actions

Parameters
string$action
Return values
mixed

◆ loadStrings()

XMLDBAction::loadStrings ( $strings)

loadStrings method, loads the required strings specified in the array parameter

Parameters
string[]$strings

◆ upgrade_savepoint_php()

XMLDBAction::upgrade_savepoint_php ( $structure)

This function will generate the PHP code needed to implement the upgrade_xxxx_savepoint() php calls in upgrade code generated from the editor.

It's used by the view_structure_php and view_table_php actions

Parameters
xmldb_structurestructure object containing all the info
Return values
stringPHP code to be used to mark a reached savepoint

Member Data Documentation

◆ $errormsg

string XMLDBAction::$errormsg
protected

Last Error produced.

Check when any invoke returns false, get with getError


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