Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
|
This class will look for data in the database that violates the foreign key definitions found in the XMLDB definitions. More...
Public Member Functions | |
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. | |
invoke () | |
Invoke method, every class will have its own returns true/false on completion, setting both errormsg and output as necessary. | |
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 Member Functions | |
check_table (xmldb_table $xmldb_table, array $metacolumns) | |
Do the checks necessary on one particular table. | |
display_results (array $violatedkeys) | |
Display a list of the problems found. | |
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 | $introstr = '' |
This string is displayed with a yes/no choice before the report is run. | |
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. | |
This class will look for data in the database that violates the foreign key definitions found in the XMLDB definitions.
Note that by default, this check does not complain about foreign key violations from, say, a userid column defined as NOT NULL DEFAULT '0'. Each 0 in that column will violate the foreign key, but we ignore them. If you want a strict check performed, then add &strict=1 to the URL.
|
protected |
Do the checks necessary on one particular table.
xmldb_table | $xmldb_table | the table definition from the install.xml file. |
array | $metacolumns | the column information read from the database. |
array | an array with two elements: First, some additional progress output, for example a list ( |
Reimplemented from XMLDBCheckAction.
|
protected |
Display a list of the problems found.
array | $problems_found | an aggregation of all the problems found by all the check_table calls. |
string | a display of all the problems found as HTML. |
Reimplemented from XMLDBCheckAction.
|
inherited |
Returns the type of output of the file.
bool |
|
inherited |
getError method, returns the last error string.
Used if the invoke() methods returns false
string |
|
inherited |
getOutput method, returns the output generated by the action.
Used after execution of the invoke() methods if they return true
string |
|
inherited |
getPostAction method, returns the action to launch after executing another one
string |
|
inherited |
getTitle method returns the title of the action (that is part of the $str array attribute
string |
Reimplemented in add_persistent_mandatory.
check_foreign_keys::init | ( | ) |
Init method, every subclass will have its own.
Reimplemented from XMLDBCheckAction.
|
inherited |
Invoke method, every class will have its own returns true/false on completion, setting both errormsg and output as necessary.
Reimplemented from XMLDBAction.
|
inherited |
launch method, used to easily call invoke methods between actions
string | $action |
mixed |
|
inherited |
loadStrings method, loads the required strings specified in the array parameter
string[] | $strings |
|
inherited |
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
xmldb_structure | structure object containing all the info |
string | PHP code to be used to mark a reached savepoint |
|
protectedinherited |
Last Error produced.
Check when any invoke returns false, get with getError
|
protectedinherited |
This string is displayed with a yes/no choice before the report is run.
You must set this to the name of a lang string in xmldb.php before calling init.