ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
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. More... | |
setTestMode ($a_testmode) | |
getTestMode () | |
performAbstraction ($a_table_name, $a_set_text_ts_fields_notnull_false=true) | |
Converts an existing (MySQL) ILIAS table in an abstract table. More... | |
countRecords ($a_table_name) | |
Check number of records before and after. More... | |
storeStep ($a_table, $a_step) | |
Store performed step. More... | |
replaceEmptyStringsWithNull ($a_table) | |
Replace empty strings with null values. More... | |
replaceEmptyDatesWithNull ($a_table) | |
Replace empty dates with null. More... | |
lowerCaseTableName ($a_table_name) | |
Lower case table and field names. More... | |
lowerCaseColumnNames ($a_table_name) | |
lower case column names More... | |
removeAutoIncrement ($a_table_name, $a_auto_inc_field) | |
Remove auto_increment attribute of a field. More... | |
removePrimaryKey ($a_table, $a_pk) | |
Remove primary key from table. More... | |
removeIndices ($a_table, $a_indices) | |
Remove Indices. More... | |
removeConstraints ($a_table, $a_constraints) | |
Remove Constraints. More... | |
alterTable ($a_table, $a_fields, $a_set_text_ts_fields_notnull_false=true, $pk="") | |
addPrimaryKey ($a_table, $a_pk) | |
addIndices ($a_table, $a_indices) | |
Add indices. More... | |
addConstraints ($a_table, $a_constraints) | |
Add constraints. More... | |
fixIndexNames ($a_table) | |
This is only used on tables that have already been abstracted but missed the "full treatment". More... | |
addAutoIncrementSequence ($a_table, $a_auto_inc_field) | |
Add autoincrement sequence. More... | |
fixClobNotNull ($a_table) | |
This is only used on tables that have already been abstracted but missed the "full treatment". More... | |
fixDatetimeValues ($a_table) | |
This is only used on tables that have already been abstracted but missed the "full treatment". More... | |
Data Fields | |
$analyzer | |
Protected Attributes | |
$ilDBInterface | |
$manager | |
$reverse | |
$testmode | |
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 12 of file class.ilMySQLAbstraction.php.
ilMySQLAbstraction::__construct | ( | ) |
Constructor.
Definition at line 40 of file class.ilMySQLAbstraction.php.
References $ilDB, ilDBConstants\MODULE_MANAGER, ilDBConstants\MODULE_REVERSE, and setTestMode().
ilMySQLAbstraction::addAutoIncrementSequence | ( | $a_table, | |
$a_auto_inc_field | |||
) |
Add autoincrement sequence.
string | table name |
string | autoincrement field |
Definition at line 601 of file class.ilMySQLAbstraction.php.
References ilDBInterface\createSequence(), ilDBInterface\fetchAssoc(), and ilDBInterface\query().
Referenced by performAbstraction().
ilMySQLAbstraction::addConstraints | ( | $a_table, | |
$a_constraints | |||
) |
Add constraints.
string | table name |
array | constraints information |
Definition at line 540 of file class.ilMySQLAbstraction.php.
References array.
Referenced by performAbstraction().
ilMySQLAbstraction::addIndices | ( | $a_table, | |
$a_indices | |||
) |
Add indices.
string | table name |
array | indices information |
Definition at line 505 of file class.ilMySQLAbstraction.php.
References $index, ilDBInterface\addIndex(), and array.
Referenced by fixIndexNames(), and performAbstraction().
ilMySQLAbstraction::addPrimaryKey | ( | $a_table, | |
$a_pk | |||
) |
$a_table | |
$a_pk |
Definition at line 487 of file class.ilMySQLAbstraction.php.
References ilDBInterface\addPrimaryKey(), and array.
Referenced by performAbstraction().
ilMySQLAbstraction::alterTable | ( | $a_table, | |
$a_fields, | |||
$a_set_text_ts_fields_notnull_false = true , |
|||
$pk = "" |
|||
) |
$a_table | ||
$a_fields | ||
bool | $a_set_text_ts_fields_notnull_false | |
string | $pk |
Definition at line 395 of file class.ilMySQLAbstraction.php.
References $d, $def, $r, array, and getTestMode().
Referenced by performAbstraction().
ilMySQLAbstraction::countRecords | ( | $a_table_name | ) |
Check number of records before and after.
string | $a_table_name |
Definition at line 198 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 616 of file class.ilMySQLAbstraction.php.
References $def, $name, array, ilDBInterface\modifyTableColumn(), and ilDBInterface\tableExists().
ilMySQLAbstraction::fixDatetimeValues | ( | $a_table | ) |
This is only used on tables that have already been abstracted but missed the "full treatment".
Definition at line 635 of file class.ilMySQLAbstraction.php.
References $def, $name, $nd, array, ilDBInterface\modifyTableColumn(), and ilDBInterface\tableExists().
ilMySQLAbstraction::fixIndexNames | ( | $a_table | ) |
This is only used on tables that have already been abstracted but missed the "full treatment".
Definition at line 573 of file class.ilMySQLAbstraction.php.
References $index, addIndices(), ilDBInterface\dropIndex(), and ilDBInterface\tableExists().
ilMySQLAbstraction::getTestMode | ( | ) |
Definition at line 69 of file class.ilMySQLAbstraction.php.
References $testmode.
Referenced by alterTable(), and performAbstraction().
ilMySQLAbstraction::lowerCaseColumnNames | ( | $a_table_name | ) |
lower case column names
string | $a_table_name |
Definition at line 312 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 | $a_table_name |
Definition at line 294 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.
$a_table_name | string |
Definition at line 82 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 331 of file class.ilMySQLAbstraction.php.
References array, and ilDBInterface\modifyTableColumn().
Referenced by performAbstraction().
ilMySQLAbstraction::removeConstraints | ( | $a_table, | |
$a_constraints | |||
) |
Remove Constraints.
string | table name |
array | constraints information |
Definition at line 375 of file class.ilMySQLAbstraction.php.
References ilDBInterface\query().
Referenced by performAbstraction().
ilMySQLAbstraction::removeIndices | ( | $a_table, | |
$a_indices | |||
) |
Remove Indices.
string | table name |
array | indices information |
Definition at line 359 of file class.ilMySQLAbstraction.php.
References $index, and ilDBInterface\query().
Referenced by performAbstraction().
ilMySQLAbstraction::removePrimaryKey | ( | $a_table, | |
$a_pk | |||
) |
Remove primary key from table.
string | table name |
array | primary key information |
Definition at line 345 of file class.ilMySQLAbstraction.php.
Referenced by performAbstraction().
ilMySQLAbstraction::replaceEmptyDatesWithNull | ( | $a_table | ) |
Replace empty dates with null.
$a_table |
Definition at line 257 of file class.ilMySQLAbstraction.php.
References $def, $ilDB, array, and ilDBInterface\tableExists().
Referenced by performAbstraction().
ilMySQLAbstraction::replaceEmptyStringsWithNull | ( | $a_table | ) |
Replace empty strings with null values.
$a_table |
Definition at line 232 of file class.ilMySQLAbstraction.php.
References $def, $ilDB, and array.
Referenced by performAbstraction().
ilMySQLAbstraction::setTestMode | ( | $a_testmode | ) |
$a_testmode |
Definition at line 60 of file class.ilMySQLAbstraction.php.
Referenced by __construct().
ilMySQLAbstraction::storeStep | ( | $a_table, | |
$a_step | |||
) |
Store performed step.
$a_table | |
$a_step |
Definition at line 216 of file class.ilMySQLAbstraction.php.
References array, ilDBInterface\execute(), and ilDBInterface\prepareManip().
Referenced by performAbstraction().
ilMySQLAbstraction::$analyzer |
Definition at line 18 of file class.ilMySQLAbstraction.php.
|
protected |
Definition at line 22 of file class.ilMySQLAbstraction.php.
|
protected |
Definition at line 26 of file class.ilMySQLAbstraction.php.
|
protected |
Definition at line 30 of file class.ilMySQLAbstraction.php.
|
protected |
Definition at line 34 of file class.ilMySQLAbstraction.php.
Referenced by getTestMode().