|
Moodle
2.2.1
http://www.collinsharper.com
|
This class represent one XMLDB Key. More...


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 | |
This class represent one XMLDB Key.
Definition at line 29 of file xmldb_key.php.
| __construct | ( | $ | name, |
| $ | type = null, |
||
| $ | fields = array(), |
||
| $ | reftable = null, |
||
| $ | reffields = null |
||
| ) |
Creates one new xmldb_key
Definition at line 39 of file xmldb_key.php.

| 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.

| calculateHash | ( | $ | recursive = false | ) |
This function calculate and set the hash of one xmldb_key
Definition at line 340 of file xmldb_key.php.

| & getFields | ( | ) |
Get the key fields
Definition at line 112 of file xmldb_key.php.

| 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.

| & getRefFields | ( | ) |
Get the key reffields
Definition at line 126 of file xmldb_key.php.

| & getRefTable | ( | ) |
Get the key reftable
Definition at line 119 of file xmldb_key.php.

| getType | ( | ) |
Get the key type
Definition at line 77 of file xmldb_key.php.

| 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.

| 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.

| readableInfo | ( | ) |
Shows info in a readable format
type
fields
foreign key
Reimplemented from xmldb_object.
Definition at line 457 of file xmldb_key.php.

| set_attributes | ( | $ | type, |
| $ | fields, | ||
| $ | reftable = null, |
||
| $ | reffields = null |
||
| ) |
Deprecated API ends here.
Set all the attributes of one xmldb_key
| string | type XMLDB_KEY_[PRIMARY|UNIQUE|FOREIGN|FOREIGN_UNIQUE] |
| array | fields an array of fieldnames to build the key over |
| string | reftable name of the table the FK points to or null |
| array | reffields an array of fieldnames in the FK table or null |
Definition at line 67 of file xmldb_key.php.

| 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.

| 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.

| $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.