Moodle  2.2.1
http://www.collinsharper.com
xmldb_key Class Reference

This class represent one XMLDB Key. More...

Inheritance diagram for xmldb_key:
Collaboration diagram for xmldb_key:

Public Member Functions

 __construct ($name, $type=null, $fields=array(), $reftable=null, $reffields=null)
 setAttributes ($type, $fields, $reftable=null, $reffields=null)
 set_attributes ($type, $fields, $reftable=null, $reffields=null)
 Deprecated API ends here.
 getType ()
 setType ($type)
 setFields ($fields)
 setRefTable ($reftable)
 setRefFields ($reffields)
getFields ()
getRefTable ()
getRefFields ()
 arr2xmldb_key ($xmlarr)
 getXMLDBKeyType ($type)
 getXMLDBKeyName ($type)
 calculateHash ($recursive=false)
 xmlOutput ()
 setFromADOKey ($adokey)
 getPHP ()
 readableInfo ()

Data Fields

 $type
 $fields
 $reftable
 $reffields

Detailed Description

This class represent one XMLDB Key.

Definition at line 29 of file xmldb_key.php.


Constructor & Destructor Documentation

__construct ( name,
type = null,
fields = array(),
reftable = null,
reffields = null 
)

Creates one new xmldb_key

Definition at line 39 of file xmldb_key.php.

Here is the call graph for this function:


Member Function Documentation

arr2xmldb_key ( xmlarr)

Load data from XML to the key

Debug the table traverse_xmlize($xmlarr); //Debug print_object ($GLOBALS['traverse_array']); //Debug $GLOBALS['traverse_array']=""; //Debug

Process key attributes (name, type, fields, reftable, reffields, comment, previous, next)

Check for valid type

Finally, set the array of fields

Check we are in a FK

Finally, set the reftable

Check we are in a FK

Finally, set the array of reffields

Set some attributes

Definition at line 133 of file xmldb_key.php.

Here is the call graph for this function:

calculateHash ( recursive = false)

This function calculate and set the hash of one xmldb_key

Definition at line 340 of file xmldb_key.php.

Here is the caller graph for this function:

& getFields ( )

Get the key fields

Definition at line 112 of file xmldb_key.php.

Here is the caller graph for this function:

getPHP ( )

Returns the PHP code needed to define one xmldb_key

The type

The fields

The FKs attributes

The reftable

The reffields

Return result

Definition at line 406 of file xmldb_key.php.

Here is the call graph for this function:

& getRefFields ( )

Get the key reffields

Definition at line 126 of file xmldb_key.php.

Here is the caller graph for this function:

& getRefTable ( )

Get the key reftable

Definition at line 119 of file xmldb_key.php.

Here is the caller graph for this function:

getType ( )

Get the key type

Definition at line 77 of file xmldb_key.php.

Here is the caller graph for this function:

getXMLDBKeyName ( type)

This function returns the correct name value for the XMLDB_KEY_XXX passed as argument

case XMLDB_KEY_CHECK: //Not supported $result = 'check'; break;

Return the normalized name

Definition at line 312 of file xmldb_key.php.

Here is the caller graph for this function:

getXMLDBKeyType ( type)

This function returns the correct XMLDB_KEY_XXX value for the string passed as argument

case 'check': //Not supported $result = XMLDB_KEY_CHECK; break;

Return the normalized XMLDB_KEY

Definition at line 283 of file xmldb_key.php.

Here is the caller graph for this function:

Shows info in a readable format

type

fields

foreign key

Reimplemented from xmldb_object.

Definition at line 457 of file xmldb_key.php.

Here is the call graph for this function:

set_attributes ( type,
fields,
reftable = null,
reffields = null 
)

Deprecated API ends here.

Set all the attributes of one xmldb_key

Parameters:
stringtype XMLDB_KEY_[PRIMARY|UNIQUE|FOREIGN|FOREIGN_UNIQUE]
arrayfields an array of fieldnames to build the key over
stringreftable name of the table the FK points to or null
arrayreffields an array of fieldnames in the FK table or null

Definition at line 67 of file xmldb_key.php.

Here is the caller graph for this function:

setAttributes ( type,
fields,
reftable = null,
reffields = null 
)

TODO: Delete for 2.1 (deprecated in 2.0). Deprecated API starts here

Definition at line 51 of file xmldb_key.php.

Here is the call graph for this function:

setFields ( fields)

Set the key fields

Definition at line 91 of file xmldb_key.php.

setFromADOKey ( adokey)

This function will set all the attributes of the xmldb_key object based on information passed in one ADOkey

Calculate the XMLDB_KEY

Set the fields, converting all them to lowercase

Some more fields

Definition at line 385 of file xmldb_key.php.

setRefFields ( reffields)

Set the key reffields

Definition at line 105 of file xmldb_key.php.

setRefTable ( reftable)

Set the key reftable

Definition at line 98 of file xmldb_key.php.

setType ( type)

Set the key type

Definition at line 84 of file xmldb_key.php.

xmlOutput ( )

This function will output the XML text for one key

Definition at line 357 of file xmldb_key.php.

Here is the call graph for this function:


Field Documentation

$fields

Definition at line 32 of file xmldb_key.php.

$reffields

Definition at line 34 of file xmldb_key.php.

$reftable

Definition at line 33 of file xmldb_key.php.

$type

Definition at line 31 of file xmldb_key.php.


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