| [ Index ] |
PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008] |
[Source view] [Print] [Project Stats]
(no description)
| File Size: | 1563 lines (54 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
| table_column($table, $oldfield, $field, $type='integer', $size='10',$signed='unsigned', $default='0', $null='not null', $after='') X-Ref |
| Add a new field to a table, or modify an existing one (if oldfield is defined). WARNING: This function is deprecated and will be removed in future versions. Please use XMLDB (see http://docs.moodle.org/en/Development:DDL_functions ). Warning: Please be careful on primary keys, as this function will eat auto_increments param: string $table the name of the table to modify. (Without the prefix.) param: string $oldfield If changing an existing column, the name of that column. param: string $field The name of the column at the end of the operation. param: string $type The type of the column at the end of the operation. TEXT, VARCHAR, CHAR, INTEGER, REAL, or TINYINT param: string $size The size of that column type. As in VARCHAR($size), or INTEGER($size). param: string $signed For numeric column types, whether that column is 'signed' or 'unsigned'. param: string $default The new default value for the column. param: string $null 'not null', or '' to allow nulls. param: string $after Which column to insert this one after. Not supported on Postgres. return: boolean Wheter the operation succeeded. |
| table_exists($table) X-Ref |
| Given one XMLDBTable, check if it exists in DB (true/false) param: XMLDBTable table to be searched for return: boolean true/false |
| field_exists($table, $field) X-Ref |
| Given one XMLDBField, check if it exists in DB (true/false) param: XMLDBTable the table param: XMLDBField the field to be searched for return: boolean true/false |
| index_exists($table, $index) X-Ref |
| Given one XMLDBIndex, check if it exists in DB (true/false) param: XMLDBTable the table param: XMLDBIndex the index to be searched for return: boolean true/false |
| check_constraint_exists($table, $field) X-Ref |
| Given one XMLDBField, check if it has a check constraint in DB param: XMLDBTable the table param: XMLDBField the field to be searched for any existing constraint return: boolean true/false |
| find_key_name($table, $xmldb_key) X-Ref |
| This function IS NOT IMPLEMENTED. ONCE WE'LL BE USING RELATIONAL INTEGRITY IT WILL BECOME MORE USEFUL. FOR NOW, JUST CALCULATE "OFFICIAL" KEY NAMES WITHOUT ACCESSING TO DB AT ALL. Given one XMLDBKey, the function returns the name of the key in DB (if exists) of false if it doesn't exist param: XMLDBTable the table to be searched param: XMLDBKey the key to be searched return: string key name of false |
| find_index_name($table, $index) X-Ref |
| Given one XMLDBIndex, the function returns the name of the index in DB (if exists) of false if it doesn't exist param: XMLDBTable the table to be searched param: XMLDBIndex the index to be searched return: string index name of false |
| find_check_constraint_name($table, $field) X-Ref |
| Given one XMLDBField, the function returns the name of the check constraint in DB (if exists) of false if it doesn't exist. Note that XMLDB limits the number of check constrainst per field to 1 "enum-like" constraint. So, if more than one is returned, only the first one will be retrieved by this funcion. param: XMLDBTable the table to be searched param: XMLDBField the field to be searched return: string check consrtaint name or false |
| find_sequence_name($table) X-Ref |
| Given one XMLDBTable, the function returns the name of its sequence in DB (if exists) of false if it doesn't exist param: XMLDBTable the table to be searched return: string sequence name of false |
| install_from_xmldb_file($file) X-Ref |
| This function will load one entire XMLDB file, generating all the needed SQL statements, specific for each RDBMS ($CFG->dbtype) and, finally, it will execute all those statements against the DB. param: $file full path to the XML file to be used return: boolean (true on success, false on error) |
| delete_tables_from_xmldb_file($file, $feedback=true ) X-Ref |
| This function will all tables found in XMLDB file from db param: $file full path to the XML file to be used param: $feedback return: boolean (true on success, false on error) |
| drop_plugin_tables($name, $file, $feedback=true) X-Ref |
| Delete all plugin tables |
| get_used_table_names() X-Ref |
| Returns names of all known tables == tables that moodle knowns about. return: array of lowercase table names |
| get_db_directories() X-Ref |
| Returns list of all directories where we expect install.xml files return: array of paths |
| create_table($table, $continue=true, $feedback=true) X-Ref |
| This function will create the table passed as argument with all its fields/keys/indexes/sequences, everything based in the XMLDB object param: XMLDBTable table object (full specs are required) param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| drop_table($table, $continue=true, $feedback=true) X-Ref |
| This function will drop the table passed as argument and all the associated objects (keys, indexes, constaints, sequences, triggers) will be dropped too. param: XMLDBTable table object (just the name is mandatory) param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| create_temp_table($table, $continue=true, $feedback=true) X-Ref |
| This function will create the temporary table passed as argument with all its fields/keys/indexes/sequences, everything based in the XMLDB object TRUNCATE the table immediately after creation. A previous process using the same persistent connection may have created the temp table and failed to drop it. In that case, the table will exist, and create_temp_table() will will succeed. NOTE: The return value is the tablename - some DBs (MSSQL at least) use special names for temp tables. param: XMLDBTable table object (full specs are required) param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: string tablename on success, false on error |
| rename_table($table, $newname, $continue=true, $feedback=true) X-Ref |
| This function will rename the table passed as argument Before renaming the index, the function will check it exists param: XMLDBTable table object (just the name is mandatory) param: string new name of the index param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| add_field($table, $field, $continue=true, $feedback=true) X-Ref |
| This function will add the field to the table passed as arguments param: XMLDBTable table object (just the name is mandatory) param: XMLDBField field object (full specs are required) param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| drop_field($table, $field, $continue=true, $feedback=true) X-Ref |
| This function will drop the field from the table passed as arguments param: XMLDBTable table object (just the name is mandatory) param: XMLDBField field object (just the name is mandatory) param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| change_field_type($table, $field, $continue=true, $feedback=true) X-Ref |
| This function will change the type of the field in the table passed as arguments param: XMLDBTable table object (just the name is mandatory) param: XMLDBField field object (full specs are required) param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| change_field_precision($table, $field, $continue=true, $feedback=true) X-Ref |
| This function will change the precision of the field in the table passed as arguments param: XMLDBTable table object (just the name is mandatory) param: XMLDBField field object (full specs are required) param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| change_field_unsigned($table, $field, $continue=true, $feedback=true) X-Ref |
| This function will change the unsigned/signed of the field in the table passed as arguments param: XMLDBTable table object (just the name is mandatory) param: XMLDBField field object (full specs are required) param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| change_field_notnull($table, $field, $continue=true, $feedback=true) X-Ref |
| This function will change the nullability of the field in the table passed as arguments param: XMLDBTable table object (just the name is mandatory) param: XMLDBField field object (full specs are required) param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| change_field_enum($table, $field, $continue=true, $feedback=true) X-Ref |
| This function will change the enum status of the field in the table passed as arguments param: XMLDBTable table object (just the name is mandatory) param: XMLDBField field object (full specs are required) param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| change_field_default($table, $field, $continue=true, $feedback=true) X-Ref |
| This function will change the default of the field in the table passed as arguments One null value in the default field means delete the default param: XMLDBTable table object (just the name is mandatory) param: XMLDBField field object (full specs are required) param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| rename_field($table, $field, $newname, $continue=true, $feedback=true) X-Ref |
| This function will rename the field in the table passed as arguments Before renaming the field, the function will check it exists param: XMLDBTable table object (just the name is mandatory) param: XMLDBField index object (full specs are required) param: string new name of the field param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| add_key($table, $key, $continue=true, $feedback=true) X-Ref |
| This function will create the key in the table passed as arguments param: XMLDBTable table object (just the name is mandatory) param: XMLDBKey index object (full specs are required) param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| drop_key($table, $key, $continue=true, $feedback=true) X-Ref |
| This function will drop the key in the table passed as arguments param: XMLDBTable table object (just the name is mandatory) param: XMLDBKey key object (full specs are required) param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| rename_key($table, $key, $newname, $continue=true, $feedback=true) X-Ref |
| This function will rename the key in the table passed as arguments Experimental. Shouldn't be used at all in normal installation/upgrade! param: XMLDBTable table object (just the name is mandatory) param: XMLDBKey key object (full specs are required) param: string new name of the key param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| add_index($table, $index, $continue=true, $feedback=true) X-Ref |
| This function will create the index in the table passed as arguments Before creating the index, the function will check it doesn't exists param: XMLDBTable table object (just the name is mandatory) param: XMLDBIndex index object (full specs are required) param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| drop_index($table, $index, $continue=true, $feedback=true) X-Ref |
| This function will drop the index in the table passed as arguments Before dropping the index, the function will check it exists param: XMLDBTable table object (just the name is mandatory) param: XMLDBIndex index object (full specs are required) param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| rename_index($table, $index, $newname, $continue=true, $feedback=true) X-Ref |
| This function will rename the index in the table passed as arguments Before renaming the index, the function will check it exists Experimental. Shouldn't be used at all! param: XMLDBTable table object (just the name is mandatory) param: XMLDBIndex index object (full specs are required) param: string new name of the index param: boolean continue to specify if must continue on error (true) or stop (false) param: boolean feedback to specify to show status info (true) or not (false) return: boolean true on success, false on error |
| change_db_encoding() X-Ref |
| No description |
| Generated: Wed Jan 14 11:33:29 2009 | Cross-referenced by PHPXref 0.7 |