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

This class represent one XMLDB Index. More...

Inheritance diagram for xmldb_index:
Collaboration diagram for xmldb_index:

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

Detailed Description

This class represent one XMLDB Index.

Definition at line 29 of file xmldb_index.php.


Constructor & Destructor Documentation

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

Creates one new xmldb_index

Definition at line 53 of file xmldb_index.php.

Here is the call graph for this function:


Member Function Documentation

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.

Here is the call graph for this function:

calculateHash ( recursive = false)

This function calculate and set the hash of one xmldb_index

Definition at line 196 of file xmldb_index.php.

Here is the caller graph for this function:

& getFields ( )

Get the index fields

Definition at line 105 of file xmldb_index.php.

Here is the caller graph for this function:

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.

Here is the call graph for this function:

getUnique ( )

Get the index unique

Definition at line 84 of file xmldb_index.php.

Here is the caller graph for this function:

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

Parameters:
stringtype XMLDB_INDEX_UNIQUE, XMLDB_INDEX_NOTUNIQUE
arrayfields an array of fieldnames to build the index over

Definition at line 76 of file xmldb_index.php.

Here is the caller graph for this function:

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.

Here is the call graph for this function:

setFields ( fields)

Set the index fields

Definition at line 98 of file xmldb_index.php.

Here is the caller graph for this function:

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.

setUnique ( unique = true)

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!

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

Reimplemented from xmldb_object.

Definition at line 299 of file xmldb_index.php.

Here is the call graph for this function:

xmlOutput ( )

This function will output the XML text for one index

Definition at line 208 of file xmldb_index.php.


Field Documentation

$fields

Definition at line 32 of file xmldb_index.php.

$unique

Definition at line 31 of file xmldb_index.php.

Note:

  • MySQL: MyISAM has a limit of 1000 bytes for any key including composed, InnoDB has limit 3500 bytes.

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:

  • MySQL: InnoDB limits size of index on single column to 767bytes (256 chars)

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.


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