Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
This class will show the PHP needed (upgrade block) to perform the desired DDL action with the specified field/key/index. More...
Public Member Functions | |
add_field_php ($structure, $table, $field) | |
This function will generate all the PHP code needed to create one field using XMLDB objects and functions. More... | |
add_index_php ($structure, $table, $index) | |
This function will generate all the PHP code needed to create one index using XMLDB objects and functions. More... | |
add_key_php ($structure, $table, $key) | |
This function will generate all the PHP code needed to create one key using XMLDB objects and functions. More... | |
change_field_default_php ($structure, $table, $field) | |
This function will generate all the PHP code needed to change the default of one field using XMLDB objects and functions. More... | |
change_field_notnull_php ($structure, $table, $field) | |
This function will generate all the PHP code needed to change the nullability of one field using XMLDB objects and functions. More... | |
change_field_precision_php ($structure, $table, $field) | |
This function will generate all the PHP code needed to change the precision of one field using XMLDB objects and functions. More... | |
change_field_type_php ($structure, $table, $field) | |
This function will generate all the PHP code needed to change the type of one field using XMLDB objects and functions. More... | |
drop_field_php ($structure, $table, $field) | |
This function will generate all the PHP code needed to drop one field using XMLDB objects and functions. More... | |
drop_index_php ($structure, $table, $index) | |
This function will generate all the PHP code needed to drop one index using XMLDB objects and functions. More... | |
drop_key_php ($structure, $table, $key) | |
This function will generate all the PHP code needed to drop one key using XMLDB objects and functions. More... | |
getDoesGenerate () | |
Returns the type of output of the file. More... | |
getError () | |
getError method, returns the last error string. More... | |
getOutput () | |
getOutput method, returns the output generated by the action. More... | |
getPostAction () | |
getPostAction method, returns the action to launch after executing another one More... | |
getTitle () | |
getTitle method returns the title of the action (that is part of the $str array attribute More... | |
init () | |
Init method, every subclass will have its own. More... | |
invoke () | |
Invoke method, every class will have its own returns true/false on completion, setting both errormsg and output as necessary. More... | |
launch ($action) | |
launch method, used to easily call invoke methods between actions More... | |
loadStrings ($strings) | |
loadStrings method, loads the required strings specified in the array parameter More... | |
rename_field_php ($structure, $table, $field) | |
This function will generate all the PHP code needed to rename one field using XMLDB objects and functions. More... | |
rename_index_php ($structure, $table, $index) | |
This function will generate all the PHP code needed to rename one index using XMLDB objects and functions. More... | |
rename_key_php ($structure, $table, $key) | |
This function will generate all the PHP code needed to rename one key using XMLDB objects and functions. More... | |
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. More... | |
Protected 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. More... | |
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. | |
string | $title |
Title of the Action (class name, by default), set by parent init automatically. | |
This class will show the PHP needed (upgrade block) to perform the desired DDL action with the specified field/key/index.
view_table_php::add_field_php | ( | $structure, | |
$table, | |||
$field | |||
) |
This function will generate all the PHP code needed to create one field using XMLDB objects and functions.
xmldb_structure | structure object containing all the info |
string | table table name |
string | field field name to be created |
string | PHP code to be used to create the field |
view_table_php::add_index_php | ( | $structure, | |
$table, | |||
$index | |||
) |
This function will generate all the PHP code needed to create one index using XMLDB objects and functions.
xmldb_structure | structure object containing all the info |
string | table table name |
string | index index name to be created |
string | PHP code to be used to create the index |
view_table_php::add_key_php | ( | $structure, | |
$table, | |||
$key | |||
) |
This function will generate all the PHP code needed to create one key using XMLDB objects and functions.
xmldb_structure | structure object containing all the info |
string | table table name |
string | key key name to be created |
string | PHP code to be used to create the key |
view_table_php::change_field_default_php | ( | $structure, | |
$table, | |||
$field | |||
) |
This function will generate all the PHP code needed to change the default of one field using XMLDB objects and functions.
xmldb_structure | structure object containing all the info |
string | table table name |
string | field field name to change null/not null |
view_table_php::change_field_notnull_php | ( | $structure, | |
$table, | |||
$field | |||
) |
This function will generate all the PHP code needed to change the nullability of one field using XMLDB objects and functions.
xmldb_structure | structure object containing all the info |
string | table table name |
string | field field name to change null/not null |
view_table_php::change_field_precision_php | ( | $structure, | |
$table, | |||
$field | |||
) |
This function will generate all the PHP code needed to change the precision of one field using XMLDB objects and functions.
xmldb_structure | structure object containing all the info |
string | table table name |
string | field field name to change precision |
view_table_php::change_field_type_php | ( | $structure, | |
$table, | |||
$field | |||
) |
This function will generate all the PHP code needed to change the type of one field using XMLDB objects and functions.
Currently these conversions are supported: integer to char char to integer number to char char to number float to char char to float
xmldb_structure | structure object containing all the info |
string | table table name |
string | field field name to change precision |
view_table_php::drop_field_php | ( | $structure, | |
$table, | |||
$field | |||
) |
This function will generate all the PHP code needed to drop one field using XMLDB objects and functions.
xmldb_structure | structure object containing all the info |
string | table table name |
string | field field name to be dropped |
string | PHP code to be used to drop the field |
view_table_php::drop_index_php | ( | $structure, | |
$table, | |||
$index | |||
) |
This function will generate all the PHP code needed to drop one index using XMLDB objects and functions.
xmldb_structure | structure object containing all the info |
string | table table name |
string | index index name to be dropped |
string | PHP code to be used to drop the index |
view_table_php::drop_key_php | ( | $structure, | |
$table, | |||
$key | |||
) |
This function will generate all the PHP code needed to drop one key using XMLDB objects and functions.
xmldb_structure | structure object containing all the info |
string | table table name |
string | key key name to be dropped |
string | PHP code to be used to drop the key |
|
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.
view_table_php::init | ( | ) |
Init method, every subclass will have its own.
Reimplemented from XMLDBAction.
view_table_php::invoke | ( | ) |
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 |
view_table_php::rename_field_php | ( | $structure, | |
$table, | |||
$field | |||
) |
This function will generate all the PHP code needed to rename one field using XMLDB objects and functions.
xmldb_structure | structure object containing all the info |
string | table table name |
string | field field name to be renamed |
string | PHP code to be used to rename the field |
view_table_php::rename_index_php | ( | $structure, | |
$table, | |||
$index | |||
) |
This function will generate all the PHP code needed to rename one index using XMLDB objects and functions.
xmldb_structure | structure object containing all the info |
string | table table name |
string | index index name to be renamed |
string | PHP code to be used to rename the index |
view_table_php::rename_key_php | ( | $structure, | |
$table, | |||
$key | |||
) |
This function will generate all the PHP code needed to rename one key using XMLDB objects and functions.
xmldb_structure | structure object containing all the info |
string | table table name |
string | key key name to be renamed |
string | PHP code to be used to rename the key |
|
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