ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
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 39 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 581 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 522 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 488 of file class.ilMySQLAbstraction.php.
References ilDBInterface\addIndex(), and array.
Referenced by fixIndexNames(), and performAbstraction().
ilMySQLAbstraction::addPrimaryKey | ( | $a_table, | |
$a_pk | |||
) |
$a_table | |
$a_pk |
Definition at line 471 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 380 of file class.ilMySQLAbstraction.php.
References $d, $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 193 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 595 of file class.ilMySQLAbstraction.php.
References 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 613 of file class.ilMySQLAbstraction.php.
References $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 554 of file class.ilMySQLAbstraction.php.
References addIndices(), ilDBInterface\dropIndex(), and ilDBInterface\tableExists().
ilMySQLAbstraction::getTestMode | ( | ) |
Definition at line 66 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 302 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 285 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 78 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 320 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 361 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 346 of file class.ilMySQLAbstraction.php.
References 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 333 of file class.ilMySQLAbstraction.php.
Referenced by performAbstraction().
ilMySQLAbstraction::replaceEmptyDatesWithNull | ( | $a_table | ) |
Replace empty dates with null.
$a_table |
Definition at line 249 of file class.ilMySQLAbstraction.php.
References $ilDB, array, and ilDBInterface\tableExists().
Referenced by performAbstraction().
ilMySQLAbstraction::replaceEmptyStringsWithNull | ( | $a_table | ) |
Replace empty strings with null values.
$a_table |
Definition at line 225 of file class.ilMySQLAbstraction.php.
Referenced by performAbstraction().
ilMySQLAbstraction::setTestMode | ( | $a_testmode | ) |
$a_testmode |
Definition at line 58 of file class.ilMySQLAbstraction.php.
Referenced by __construct().
ilMySQLAbstraction::storeStep | ( | $a_table, | |
$a_step | |||
) |
Store performed step.
$a_table | |
$a_step |
Definition at line 210 of file class.ilMySQLAbstraction.php.
References array, ilDBInterface\execute(), and ilDBInterface\prepareManip().
Referenced by performAbstraction().
ilMySQLAbstraction::$analyzer |
Definition at line 17 of file class.ilMySQLAbstraction.php.
|
protected |
Definition at line 21 of file class.ilMySQLAbstraction.php.
|
protected |
Definition at line 25 of file class.ilMySQLAbstraction.php.
|
protected |
Definition at line 29 of file class.ilMySQLAbstraction.php.
|
protected |
Definition at line 33 of file class.ilMySQLAbstraction.php.
Referenced by getTestMode().