Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
|
Public Member Functions | |
__construct ($name) | |
Creates one new xmldb_object. | |
checkName () | |
This function will check if one key name is ok or no (true/false) only lowercase a-z, 0-9 and _ are allowed. | |
checkNameValues ($arr) | |
This function will check that all the elements in one array have a correct name [a-z0-9_]. | |
comma2array ($string) | |
Returns one array of elements from one comma separated string, supporting quoted strings containing commas and concat function calls. | |
debug ($message) | |
This function will perform the central debug of all the XMLDB classes being called automatically every time one error is found. | |
findObjectInArray ($objectname, $arr) | |
Returns the position of one object in the array. | |
fixPrevNext (&$arr) | |
Reconstruct previous/next attributes. | |
getComment () | |
This function returns the comment of one xmldb_object. | |
getError () | |
This function will return the error detected in the object. | |
getHash () | |
This function returns the hash of one xmldb_object. | |
getName () | |
This function will return the name of the xmldb_object. | |
getNext () | |
This function will return the name of the next xmldb_object. | |
getPrevious () | |
This function will return the name of the previous xmldb_object. | |
hasChanged () | |
This function returns true/false, if the xmldb_object has changed. | |
isLoaded () | |
This function returns true/false, if the xmldb_object has been loaded. | |
orderElements ($arr) | |
This function will order all the elements in one array, following the previous/next rules. | |
readableInfo () | |
This function will display a readable info about the xmldb_object (should be implemented inside each XMLDBxxx object) | |
setChanged ($changed=true) | |
This function will set the changed field of the xmldb_object. | |
setComment ($comment) | |
This function will set the comment of the xmldb_object. | |
setHash ($hash) | |
This function will set the hash of the xmldb_object. | |
setLoaded ($loaded=true) | |
This function will set the loaded field of the xmldb_object. | |
setName ($name) | |
This function will set the name field of the xmldb_object. | |
setNext ($next) | |
This function will set the next of the xmldb_object. | |
setPrevious ($previous) | |
This function will set the previous of the xmldb_object. | |
validateDefinition (xmldb_table $xmldb_table=null) | |
Validates the definition of objects and returns error message. | |
xmldb_object::__construct | ( | $name | ) |
Creates one new xmldb_object.
string | $name |
Reimplemented in xmldb_file, xmldb_structure, and xmldb_table.
xmldb_object::checkName | ( | ) |
This function will check if one key name is ok or no (true/false) only lowercase a-z, 0-9 and _ are allowed.
bool |
xmldb_object::checkNameValues | ( | $arr | ) |
This function will check that all the elements in one array have a correct name [a-z0-9_].
array | $arr |
bool |
xmldb_object::comma2array | ( | $string | ) |
Returns one array of elements from one comma separated string, supporting quoted strings containing commas and concat function calls.
string | $string |
array |
xmldb_object::debug | ( | $message | ) |
This function will perform the central debug of all the XMLDB classes being called automatically every time one error is found.
Apart from the main actions performed in it (XMLDB agnostic) it looks for one function called xmldb_debug() and invokes it, passing both the message code and the whole object. So, to perform custom debugging just add such function to your libs.
Call to the external hook function can be disabled by request by defining XMLDB_SKIP_DEBUG_HOOK
string | $message |
xmldb_object::findObjectInArray | ( | $objectname, | |
$arr ) |
Returns the position of one object in the array.
string | $objectname | |
array | $arr |
mixed |
xmldb_object::fixPrevNext | ( | & | $arr | ) |
Reconstruct previous/next attributes.
array | $arr |
bool | true if $arr modified |
xmldb_object::getComment | ( | ) |
This function returns the comment of one xmldb_object.
string |
xmldb_object::getError | ( | ) |
This function will return the error detected in the object.
string |
xmldb_object::getHash | ( | ) |
This function returns the hash of one xmldb_object.
string |
xmldb_object::getName | ( | ) |
This function will return the name of the xmldb_object.
string |
xmldb_object::getNext | ( | ) |
This function will return the name of the next xmldb_object.
string |
xmldb_object::getPrevious | ( | ) |
This function will return the name of the previous xmldb_object.
string |
xmldb_object::hasChanged | ( | ) |
This function returns true/false, if the xmldb_object has changed.
bool |
xmldb_object::isLoaded | ( | ) |
This function returns true/false, if the xmldb_object has been loaded.
bool |
xmldb_object::orderElements | ( | $arr | ) |
This function will order all the elements in one array, following the previous/next rules.
array | $arr |
array|bool |
xmldb_object::readableInfo | ( | ) |
This function will display a readable info about the xmldb_object (should be implemented inside each XMLDBxxx object)
string |
Reimplemented in xmldb_field, xmldb_index, and xmldb_key.
xmldb_object::setChanged | ( | $changed = true | ) |
This function will set the changed field of the xmldb_object.
bool | $changed |
xmldb_object::setComment | ( | $comment | ) |
This function will set the comment of the xmldb_object.
string | $comment |
xmldb_object::setHash | ( | $hash | ) |
This function will set the hash of the xmldb_object.
string | $hash |
xmldb_object::setLoaded | ( | $loaded = true | ) |
This function will set the loaded field of the xmldb_object.
bool | $loaded |
xmldb_object::setName | ( | $name | ) |
This function will set the name field of the xmldb_object.
string | $name |
xmldb_object::setNext | ( | $next | ) |
This function will set the next of the xmldb_object.
string | $next |
xmldb_object::setPrevious | ( | $previous | ) |
This function will set the previous of the xmldb_object.
string | $previous |
xmldb_object::validateDefinition | ( | xmldb_table | $xmldb_table = null | ) |
Validates the definition of objects and returns error message.
The error message should not be localised because it is intended for developers, end users and admins should never see these problems!
xmldb_table | $xmldb_table | optional when object is table |
string | null if ok, error message if problem found |
Reimplemented in xmldb_field, xmldb_index, and xmldb_table.