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


Public Member Functions | |
| __construct ($name, $type=null, $fields=array()) | |
| setAttributes ($type, $fields) | |
| set_attributes ($type, $fields) | |
| Deprecated API ends here. | |
| getUnique () | |
| setUnique ($unique=true) | |
| setFields ($fields) | |
| & | getFields () |
| arr2xmldb_index ($xmlarr) | |
| calculateHash ($recursive=false) | |
| xmlOutput () | |
| setFromADOIndex ($adoindex) | |
| getPHP () | |
| readableInfo () | |
| validateDefinition (xmldb_table $xmldb_table=null) | |
Data Fields | |
| $unique | |
| $fields | |
| const | INDEX_COMPOSED_MAX_BYTES = 999 |
| const | INDEX_MAX_BYTES = 765 |
This class represent one XMLDB Index.
Definition at line 29 of file xmldb_index.php.
| __construct | ( | $ | name, |
| $ | type = null, |
||
| $ | fields = array() |
||
| ) |
Creates one new xmldb_index
Definition at line 53 of file xmldb_index.php.

| arr2xmldb_index | ( | $ | xmlarr | ) |
Load data from XML to the index
Debug the table traverse_xmlize($xmlarr); //Debug print_object ($GLOBALS['traverse_array']); //Debug $GLOBALS['traverse_array']=""; //Debug
Process key attributes (name, unique, fields, comment, previous, next)
Finally, set the array of fields
Set some attributes
Definition at line 112 of file xmldb_index.php.

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

| & getFields | ( | ) |
Get the index fields
Definition at line 105 of file xmldb_index.php.

| getPHP | ( | ) |
Returns the PHP code needed to define one xmldb_index
The type
The fields
Return result
Definition at line 251 of file xmldb_index.php.

| getUnique | ( | ) |
Get the index unique
Definition at line 84 of file xmldb_index.php.

| readableInfo | ( | ) |
Shows info in a readable format
unique
fields
Reimplemented from xmldb_object.
Definition at line 276 of file xmldb_index.php.
| set_attributes | ( | $ | type, |
| $ | fields | ||
| ) |
Deprecated API ends here.
Set all the attributes of one xmldb_index
| string | type XMLDB_INDEX_UNIQUE, XMLDB_INDEX_NOTUNIQUE |
| array | fields an array of fieldnames to build the index over |
Definition at line 76 of file xmldb_index.php.

| setAttributes | ( | $ | type, |
| $ | fields | ||
| ) |
TODO: Delete for 2.1 (deprecated in 2.0). Deprecated API starts here
Definition at line 62 of file xmldb_index.php.

| setFields | ( | $ | fields | ) |
Set the index fields
Definition at line 98 of file xmldb_index.php.

| setFromADOIndex | ( | $ | adoindex | ) |
This function will set all the attributes of the xmldb_index object based on information passed in one ADOindex
Set the unique field
Set the fields, converting all them to lowercase
Some more fields
Definition at line 236 of file xmldb_index.php.
Set the index unique
Definition at line 91 of file xmldb_index.php.
| validateDefinition | ( | xmldb_table $ | xmldb_table = null | ) |
Validates the index restrictions.
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 |
Reimplemented from xmldb_object.
Definition at line 299 of file xmldb_index.php.

| xmlOutput | ( | ) |
This function will output the XML text for one index
Definition at line 208 of file xmldb_index.php.
| $fields |
Definition at line 32 of file xmldb_index.php.
| $unique |
Definition at line 31 of file xmldb_index.php.
| const INDEX_COMPOSED_MAX_BYTES = 999 |
Note:
max length of composed indexes, one utf-8 char is 3 bytes in the worst case
Definition at line 40 of file xmldb_index.php.
| const INDEX_MAX_BYTES = 765 |
Note:
single column index length limit, one utf-8 char is 3 bytes in the worst case
Definition at line 48 of file xmldb_index.php.