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

Public Member Functions

 __construct ($name)
 isLoaded ()
 hasChanged ()
 getComment ()
 getHash ()
 getPrevious ()
 getNext ()
 getName ()
 getError ()
 setComment ($comment)
 setPrevious ($previous)
 setNext ($next)
 setHash ($hash)
 setLoaded ($loaded=true)
 setChanged ($changed=true)
 setName ($name)
 checkName ()
 checkNameValues (&$arr)
 fixPrevNext (&$arr)
 checkPreviousNextValues (&$arr)
 orderElements ($arr)
findObjectInArray ($objectname, $arr)
 readableInfo ()
 debug ($message)
 comma2array ($string)
 validateDefinition (xmldb_table $xmldb_table=null)

Data Fields

 $name
 $comment
 $previous
 $next
 $hash
 $loaded
 $changed
 $errormsg

Detailed Description

This class represent the XMLDB base class where all the common pieces are defined

Definition at line 30 of file xmldb_object.php.


Constructor & Destructor Documentation

__construct ( name)

Creates one new xmldb_object

Reimplemented in XMLDBField, XMLDBTable, XMLDBKey, XMLDBIndex, xmldb_file, xmldb_structure, and xmldb_table.

Definition at line 44 of file xmldb_object.php.


Member Function Documentation

checkName ( )

This function will check if one key name is ok or no (true/false) only lowercase a-z, 0-9 and _ are allowed

Definition at line 164 of file xmldb_object.php.

checkNameValues ( &$  arr)

This function will check that all the elements in one array have a correct name [a-z0-9_]

TODO: Perhaps, add support for reserved words

Check the name only contains valid chars

Check there aren't duplicate names

Definition at line 177 of file xmldb_object.php.

Here is the call graph for this function:

Here is the caller graph for this function:

This function will check that all the elements in one array have a consistent info in their previous/next fields

Check that only one element has the previous not set

Check that only one element has the next not set

Check that all the previous elements are existing elements

Check that all the next elements are existing elements

Check that there aren't duplicates in the previous values

Check that there aren't duplicates in the next values

Check that there aren't next values pointing to themselves

Check that there aren't prev values pointing to themselves

Definition at line 239 of file xmldb_object.php.

Here is the call graph for this function:

Here is the caller graph for this function:

comma2array ( string)

Returns one array of elements from one comma separated string, supporting quoted strings containing commas and concat function calls

Extract all the concat elements from the string

Extract all the quoted elements from the string (skipping backslashed quotes that are part of the content.

Explode safely the string

Put the concat and quoted elements back again, trimming every element

Clear some spaces

Replace the quoted elements if exists

Replace the concat elements if exists

Delete any backslash used for quotes. XMLDB stuff will add them before insert

Definition at line 434 of file xmldb_object.php.

Here is the caller graph for this function:

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

Check for xmldb_debug($message, $xmldb_object)

If exists and XMLDB_SKIP_DEBUG_HOOK is undefined

Definition at line 420 of file xmldb_object.php.

Here is the caller graph for this function:

& findObjectInArray ( objectname,
arr 
)

Returns the position of one object in the array.

Definition at line 391 of file xmldb_object.php.

Here is the caller graph for this function:

fixPrevNext ( &$  arr)

Reconstruct previous/next attributes.

Definition at line 206 of file xmldb_object.php.

Here is the caller graph for this function:

This function returns the comment of one xmldb_object

Definition at line 72 of file xmldb_object.php.

getError ( )

This function will return the error detected in the object

Definition at line 107 of file xmldb_object.php.

Here is the caller graph for this function:

getHash ( )

This function returns the hash of one xmldb_object

Definition at line 79 of file xmldb_object.php.

Here is the caller graph for this function:

getName ( )

This function will return the name of the xmldb_object

Definition at line 100 of file xmldb_object.php.

Here is the caller graph for this function:

getNext ( )

This function will return the name of the next xmldb_object

Definition at line 93 of file xmldb_object.php.

This function will return the name of the previous xmldb_object

Definition at line 86 of file xmldb_object.php.

Here is the caller graph for this function:

This function returns true/false, if the xmldb_object has changed

Definition at line 65 of file xmldb_object.php.

isLoaded ( )

This function returns true/false, if the xmldb_object has been loaded

Definition at line 58 of file xmldb_object.php.

Here is the caller graph for this function:

orderElements ( arr)

This function will order all the elements in one array, following the previous/next rules

Create a new array

Get the element without previous

Follow the next rules

Compare number of elements between original and new array

Check that previous/next is ok (redundant but...)

Definition at line 344 of file xmldb_object.php.

Here is the call graph for this function:

Here is the caller graph for this function:

This function will display a readable info about the xmldb_object (should be implemented inside each XMLDBxxx object)

Reimplemented in xmldb_field, xmldb_key, and xmldb_index.

Definition at line 405 of file xmldb_object.php.

Here is the caller graph for this function:

setChanged ( changed = true)

This function will set the changed field of the xmldb_object

Definition at line 149 of file xmldb_object.php.

Here is the caller graph for this function:

setComment ( comment)

This function will set the comment of the xmldb_object

Definition at line 114 of file xmldb_object.php.

setHash ( hash)

This function will set the hash of the xmldb_object

Definition at line 135 of file xmldb_object.php.

setLoaded ( loaded = true)

This function will set the loaded field of the xmldb_object

Definition at line 142 of file xmldb_object.php.

setName ( name)

This function will set the name field of the xmldb_object

Definition at line 155 of file xmldb_object.php.

setNext ( next)

This function will set the next of the xmldb_object

Definition at line 128 of file xmldb_object.php.

setPrevious ( previous)

This function will set the previous of the xmldb_object

Definition at line 121 of file xmldb_object.php.

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!

Parameters:
xmldb_table$xmldb_tableoptional when object is table
Returns:
string null if ok, error message if problem found

Reimplemented in xmldb_field, and xmldb_index.

Definition at line 491 of file xmldb_object.php.


Field Documentation

$changed

Definition at line 38 of file xmldb_object.php.

Definition at line 33 of file xmldb_object.php.

$errormsg

Definition at line 39 of file xmldb_object.php.

$hash

Definition at line 36 of file xmldb_object.php.

$loaded

Definition at line 37 of file xmldb_object.php.

$name

Definition at line 32 of file xmldb_object.php.

$next

Definition at line 35 of file xmldb_object.php.

$previous

Definition at line 34 of file xmldb_object.php.


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