ILIAS
Release_4_0_x_branch Revision 61816
|
This class includes methods that help to abstract ILIAS 3.10.x MySQL tables for the use with MDB2 abstraction layer and full compliance mode support. More...
Public Member Functions | |
__construct () | |
Constructor. | |
setTestMode ($a_testmode) | |
Set Test Mode. | |
getTestMode () | |
Get Test Mode. | |
performAbstraction ($a_table_name, $a_set_text_ts_fields_notnull_false=true) | |
Converts an existing (MySQL) ILIAS table in an abstract table. | |
countRecords ($a_table_name) | |
Check number of records before and after. | |
storeStep ($a_table, $a_step) | |
Store performed step. | |
replaceEmptyStringsWithNull ($a_table) | |
Replace empty strings with null values. | |
replaceEmptyDatesWithNull ($a_table) | |
Replace empty dates with null. | |
lowerCaseTableName ($a_table_name) | |
Lower case table and field names. | |
lowerCaseColumnNames ($a_table_name) | |
lower case column names | |
removeAutoIncrement ($a_table_name, $a_auto_inc_field) | |
Remove auto_increment attribute of a field. | |
removePrimaryKey ($a_table, $a_pk) | |
Remove primary key from table. | |
removeIndices ($a_table, $a_indices) | |
Remove Indices. | |
removeConstraints ($a_table, $a_constraints) | |
Remove Constraints. | |
alterTable ($a_table, $a_fields, $a_set_text_ts_fields_notnull_false=true, $pk="") | |
Use abstract types as delivered by MDB2 to alter table and make it use only MDB2 known types. | |
addPrimaryKey ($a_table, $a_pk) | |
Add primary key. | |
addIndices ($a_table, $a_indices) | |
Add indices. | |
addConstraints ($a_table, $a_constraints) | |
Add constraints. | |
fixIndexNames ($a_table) | |
This is only used on tables that have already been abstracted but missed the "full treatment". | |
addAutoIncrementSequence ($a_table, $a_auto_inc_field) | |
Add autoincrement sequence. | |
fixClobNotNull ($a_table) | |
This is only used on tables that have already been abstracted but missed the "full treatment". | |
fixDatetimeValues ($a_table) | |
This is only used on tables that have already been abstracted but missed the "full treatment". |
Data Fields | |
$analyzer |
This class includes methods that help to abstract ILIAS 3.10.x MySQL tables for the use with MDB2 abstraction layer and full compliance mode support.
Definition at line 14 of file class.ilMySQLAbstraction.php.
ilMySQLAbstraction::__construct | ( | ) |
Constructor.
Definition at line 21 of file class.ilMySQLAbstraction.php.
References $ilDB, and setTestMode().
ilMySQLAbstraction::addAutoIncrementSequence | ( | $a_table, | |
$a_auto_inc_field | |||
) |
Add autoincrement sequence.
string | table name |
string | autoincrement field |
Definition at line 633 of file class.ilMySQLAbstraction.php.
Referenced by performAbstraction().
ilMySQLAbstraction::addConstraints | ( | $a_table, | |
$a_constraints | |||
) |
Add constraints.
string | table name |
array | constraints information |
Definition at line 562 of file class.ilMySQLAbstraction.php.
References $f.
Referenced by performAbstraction().
ilMySQLAbstraction::addIndices | ( | $a_table, | |
$a_indices | |||
) |
Add indices.
string | table name |
array | indices information |
Definition at line 521 of file class.ilMySQLAbstraction.php.
References $f.
Referenced by fixIndexNames(), and performAbstraction().
ilMySQLAbstraction::addPrimaryKey | ( | $a_table, | |
$a_pk | |||
) |
Add primary key.
string | table name |
array | primary key information |
Definition at line 502 of file class.ilMySQLAbstraction.php.
References $f.
Referenced by performAbstraction().
ilMySQLAbstraction::alterTable | ( | $a_table, | |
$a_fields, | |||
$a_set_text_ts_fields_notnull_false = true , |
|||
$pk = "" |
|||
) |
Use abstract types as delivered by MDB2 to alter table and make it use only MDB2 known types.
string | table name |
array | fields information |
Definition at line 391 of file class.ilMySQLAbstraction.php.
References $d, getTestMode(), and MDB2\isError().
Referenced by performAbstraction().
ilMySQLAbstraction::countRecords | ( | $a_table_name | ) |
Check number of records before and after.
Definition at line 196 of file class.ilMySQLAbstraction.php.
Referenced by performAbstraction().
ilMySQLAbstraction::fixClobNotNull | ( | $a_table | ) |
This is only used on tables that have already been abstracted but missed the "full treatment".
Definition at line 648 of file class.ilMySQLAbstraction.php.
References $name.
ilMySQLAbstraction::fixDatetimeValues | ( | $a_table | ) |
This is only used on tables that have already been abstracted but missed the "full treatment".
Definition at line 669 of file class.ilMySQLAbstraction.php.
References $name.
ilMySQLAbstraction::fixIndexNames | ( | $a_table | ) |
This is only used on tables that have already been abstracted but missed the "full treatment".
Definition at line 601 of file class.ilMySQLAbstraction.php.
References addIndices().
ilMySQLAbstraction::getTestMode | ( | ) |
Get Test Mode.
Definition at line 55 of file class.ilMySQLAbstraction.php.
Referenced by alterTable(), and performAbstraction().
ilMySQLAbstraction::lowerCaseColumnNames | ( | $a_table_name | ) |
lower case column names
Definition at line 304 of file class.ilMySQLAbstraction.php.
References $ilDB, $result, and $row.
Referenced by performAbstraction().
ilMySQLAbstraction::lowerCaseTableName | ( | $a_table_name | ) |
Lower case table and field names.
string | table name |
Definition at line 288 of file class.ilMySQLAbstraction.php.
References $ilDB.
Referenced by performAbstraction().
ilMySQLAbstraction::performAbstraction | ( | $a_table_name, | |
$a_set_text_ts_fields_notnull_false = true |
|||
) |
Converts an existing (MySQL) ILIAS table in an abstract table.
This means the table conforms to the MDB2 field types, uses sequences instead of auto_increment.
string | table name |
Definition at line 67 of file class.ilMySQLAbstraction.php.
References addAutoIncrementSequence(), addConstraints(), addIndices(), addPrimaryKey(), alterTable(), countRecords(), getTestMode(), lowerCaseColumnNames(), lowerCaseTableName(), removeAutoIncrement(), removeConstraints(), removeIndices(), removePrimaryKey(), replaceEmptyDatesWithNull(), replaceEmptyStringsWithNull(), and storeStep().
ilMySQLAbstraction::removeAutoIncrement | ( | $a_table_name, | |
$a_auto_inc_field | |||
) |
Remove auto_increment attribute of a field.
string | table name |
string | autoincrement field |
Definition at line 325 of file class.ilMySQLAbstraction.php.
Referenced by performAbstraction().
ilMySQLAbstraction::removeConstraints | ( | $a_table, | |
$a_constraints | |||
) |
Remove Constraints.
string | table name |
array | constraints information |
Definition at line 370 of file class.ilMySQLAbstraction.php.
Referenced by performAbstraction().
ilMySQLAbstraction::removeIndices | ( | $a_table, | |
$a_indices | |||
) |
Remove Indices.
string | table name |
array | indices information |
Definition at line 353 of file class.ilMySQLAbstraction.php.
Referenced by performAbstraction().
ilMySQLAbstraction::removePrimaryKey | ( | $a_table, | |
$a_pk | |||
) |
Remove primary key from table.
string | table name |
array | primary key information |
Definition at line 339 of file class.ilMySQLAbstraction.php.
Referenced by performAbstraction().
ilMySQLAbstraction::replaceEmptyDatesWithNull | ( | $a_table | ) |
Replace empty dates with null.
Definition at line 243 of file class.ilMySQLAbstraction.php.
References $ilDB.
Referenced by performAbstraction().
ilMySQLAbstraction::replaceEmptyStringsWithNull | ( | $a_table | ) |
Replace empty strings with null values.
Definition at line 220 of file class.ilMySQLAbstraction.php.
References $ilDB.
Referenced by performAbstraction().
ilMySQLAbstraction::setTestMode | ( | $a_testmode | ) |
Set Test Mode.
boolean | $a_testmode | Test Mode |
Definition at line 45 of file class.ilMySQLAbstraction.php.
Referenced by __construct().
ilMySQLAbstraction::storeStep | ( | $a_table, | |
$a_step | |||
) |
Store performed step.
Definition at line 210 of file class.ilMySQLAbstraction.php.
Referenced by performAbstraction().
ilMySQLAbstraction::$analyzer |
Definition at line 16 of file class.ilMySQLAbstraction.php.