ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Interface ilDBInterface. More...
Public Member Functions | |
doesCollationSupportMB4Strings () | |
sanitizeMB4StringIfNotSupported ($query) | |
initFromIniFile ($tmpClientIniFile=null) | |
connect ($return_false_on_error=false) | |
nextId ($table_name) | |
createTable ($table_name, $fields, $drop_table=false, $ignore_erros=false) | |
addPrimaryKey ($table_name, $primary_keys) | |
createSequence ($table_name, $start=1) | |
getSequenceName ($table_name) | |
tableExists ($table_name) | |
tableColumnExists ($table_name, $column_name) | |
addTableColumn ($table_name, $column_name, $attributes) | |
dropTable ($table_name, $error_if_not_existing=true) | |
renameTable ($old_name, $new_name) | |
query ($query) | |
Run a (read-only) Query on the database. More... | |
fetchAll ($query_result, $fetch_mode=ilDBConstants::FETCHMODE_ASSOC) | |
dropSequence ($table_name) | |
dropTableColumn ($table_name, $column_name) | |
renameTableColumn ($table_name, $column_old_name, $column_new_name) | |
insert ($table_name, $values) | |
fetchObject ($query_result) | |
update ($table_name, $values, $where) | |
manipulate ($query) | |
Run a (write) Query on the database. More... | |
fetchAssoc ($query_result) | |
numRows ($query_result) | |
quote ($value, $type) | |
addIndex ($table_name, $fields, $index_name='', $fulltext=false) | |
indexExistsByFields ($table_name, $fields) | |
getDSN () | |
Get DSN. More... | |
getDBType () | |
Get DSN. More... | |
lockTables ($tables) | |
Abstraction of lock table. More... | |
unlockTables () | |
Unlock tables locked by previous lock table calls. More... | |
in ($field, $values, $negate=false, $type="") | |
queryF ($query, $types, $values) | |
manipulateF ($query, $types, $values) | |
useSlave ($bool) | |
Return false iff slave is not supported. More... | |
setLimit ($limit, $offset) | |
like ($column, $type, $value="?", $case_insensitive=true) | |
Generate a like subquery. More... | |
now () | |
replace ($table, $primaryKeys, $otherColumns) | |
Replace into method. More... | |
equals ($columns, $value, $type, $emptyOrNull=false) | |
setDBUser ($user) | |
setDBPort ($port) | |
setDBPassword ($password) | |
setDBHost ($host) | |
upper ($a_exp) | |
lower ($a_exp) | |
substr ($a_exp) | |
prepare ($a_query, $a_types=null, $a_result_types=null) | |
Prepare a query (SELECT) statement to be used with execute. More... | |
prepareManip ($a_query, $a_types=null) | |
enableResultBuffering ($a_status) | |
execute ($stmt, $data=array()) | |
sequenceExists ($sequence) | |
listSequences () | |
supports ($feature) | |
supportsFulltext () | |
supportsSlave () | |
supportsTransactions () | |
listTables () | |
loadModule ($module) | |
getAllowedAttributes () | |
concat (array $values, $allow_null=true) | |
locate ($a_needle, $a_string, $a_start_pos=1) | |
quoteIdentifier ($identifier, $check_option=false) | |
modifyTableColumn ($table, $column, $attributes) | |
free ($a_st) | |
checkTableName ($a_name) | |
beginTransaction () | |
commit () | |
rollback () | |
constraintName ($a_table, $a_constraint) | |
dropIndex ($a_table, $a_name="i1") | |
createDatabase ($a_name, $a_charset="utf8", $a_collation="") | |
dropIndexByFields ($table_name, $afields) | |
getPrimaryKeyIdentifier () | |
addFulltextIndex ($table_name, $afields, $a_name='in') | |
dropFulltextIndex ($a_table, $a_name) | |
isFulltextIndex ($a_table, $a_name) | |
setStorageEngine ($storage_engine) | |
getStorageEngine () | |
buildAtomQuery () | |
groupConcat ($a_field_name, $a_seperator=",", $a_order=null) | |
cast ($a_field_name, $a_dest_type) | |
Static Public Member Functions | |
static | getReservedWords () |
Get reserved words. More... | |
static | isReservedWord ($a_word) |
Interface ilDBInterface.
Definition at line 9 of file interface.ilDBInterface.php.
ilDBInterface::addFulltextIndex | ( | $table_name, | |
$afields, | |||
$a_name = 'in' |
|||
) |
$table_name | ||
$afields | ||
string | $a_name |
Implemented in ilDBPdo, and ilDBPdoMySQLInnoDB.
ilDBInterface::addIndex | ( | $table_name, | |
$fields, | |||
$index_name = '' , |
|||
$fulltext = false |
|||
) |
$table_name | ||
$fields | ||
string | $index_name | |
bool | $fulltext |
Implemented in ilDBPdo, and ilDBPdoPostgreSQL.
ilDBInterface::addPrimaryKey | ( | $table_name, | |
$primary_keys | |||
) |
$table_name | string |
$primary_keys | array |
Implemented in ilDBPdoPostgreSQL, and ilDBPdo.
ilDBInterface::addTableColumn | ( | $table_name, | |
$column_name, | |||
$attributes | |||
) |
$table_name | string |
$column_name | string |
$attributes | array |
Implemented in ilDBPdo.
Referenced by ilDBUpdateNewObjectType\varchar2text().
ilDBInterface::beginTransaction | ( | ) |
ilDBInterface::buildAtomQuery | ( | ) |
Implemented in ilDBPdo, and ilDBPdoMySQLGalera.
Referenced by ilChangeEvent\_syncObjectStats().
ilDBInterface::cast | ( | $a_field_name, | |
$a_dest_type | |||
) |
ilDBInterface::checkTableName | ( | $a_name | ) |
ilDBInterface::commit | ( | ) |
ilDBInterface::concat | ( | array | $values, |
$allow_null = true |
|||
) |
ilDBInterface::connect | ( | $return_false_on_error = false | ) |
bool | $return_false_on_error |
Implemented in ilDBPdo, and ilDBPdoPostgreSQL.
Referenced by ilDatabaseBaseTest\connect(), and ilDatabaseImplementationBaseTest\connect().
ilDBInterface::constraintName | ( | $a_table, | |
$a_constraint | |||
) |
ilDBInterface::createDatabase | ( | $a_name, | |
$a_charset = "utf8" , |
|||
$a_collation = "" |
|||
) |
ilDBInterface::createSequence | ( | $table_name, | |
$start = 1 |
|||
) |
$table_name | ||
int | $start |
Implemented in ilDBPdo, and ilDBPdoPostgreSQL.
ilDBInterface::createTable | ( | $table_name, | |
$fields, | |||
$drop_table = false , |
|||
$ignore_erros = false |
|||
) |
$table_name | ||
$fields | ||
bool | $drop_table | |
bool | $ignore_erros |
Implemented in ilDBPdoPostgreSQL, and ilDBPdo.
ilDBInterface::doesCollationSupportMB4Strings | ( | ) |
Implemented in ilDBPdo, and ilDBPdoMySQL.
ilDBInterface::dropFulltextIndex | ( | $a_table, | |
$a_name | |||
) |
ilDBInterface::dropIndex | ( | $a_table, | |
$a_name = "i1" |
|||
) |
ilDBInterface::dropIndexByFields | ( | $table_name, | |
$afields | |||
) |
ilDBInterface::dropSequence | ( | $table_name | ) |
$table_name | string |
Implemented in ilDBPdo.
ilDBInterface::dropTable | ( | $table_name, | |
$error_if_not_existing = true |
|||
) |
$table_name | ||
bool | $error_if_not_existing |
Implemented in ilDBPdo, and ilDBPdoPostgreSQL.
ilDBInterface::dropTableColumn | ( | $table_name, | |
$column_name | |||
) |
$table_name | string |
$column_name | string |
Implemented in ilDBPdo.
Referenced by ilDBUpdateNewObjectType\varchar2text().
ilDBInterface::enableResultBuffering | ( | $a_status | ) |
$a_status |
Implemented in ilDBPdo.
ilDBInterface::equals | ( | $columns, | |
$value, | |||
$type, | |||
$emptyOrNull = false |
|||
) |
ilDBInterface::execute | ( | $stmt, | |
$data = array() |
|||
) |
$stmt | ||
array | $data |
ilDatabaseException |
Referenced by ilDBPdo\autoExecute(), ilDBPdo\enableResultBuffering(), and ilDBPdo\update().
ilDBInterface::fetchAll | ( | $query_result, | |
$fetch_mode = ilDBConstants::FETCHMODE_ASSOC |
|||
) |
$query_result | ||
int | $fetch_mode |
Referenced by ilDBPdo\query().
ilDBInterface::fetchAssoc | ( | $query_result | ) |
$query_result | ilDBStatement |
Implemented in ilDBPdo.
Referenced by ilChangeEvent\_syncObjectStats(), ilGlossaryDefinition\create(), ilGlossaryDefinition\delete(), ilObjTestDynamicQuestionSetConfig\getPoolQuestionChangeListener(), ilGlossaryDefinition\moveDown(), and ilGlossaryDefinition\moveUp().
ilDBInterface::fetchObject | ( | $query_result | ) |
ilDBInterface::free | ( | $a_st | ) |
$a_st |
Referenced by ilDBPdo\autoExecute(), ilDBPdo\modifyTableColumn(), and ilDBPdo\update().
ilDBInterface::getAllowedAttributes | ( | ) |
Implemented in ilDBPdo.
ilDBInterface::getDBType | ( | ) |
Get DSN.
This must be overwritten in DBMS specific class.
Implemented in ilDBPdo.
Referenced by ilDatabaseAtomBaseTest\testWrongIsolationLevel().
ilDBInterface::getDSN | ( | ) |
Get DSN.
int | $fetchMode |
Implemented in ilDBPdo.
ilDBInterface::getPrimaryKeyIdentifier | ( | ) |
Implemented in ilDBPdo, and ilDBPdoPostgreSQL.
|
static |
Get reserved words.
This must be overwritten in DBMS specific class. This is mainly used to check whether a new identifier can be problematic because it is a reserved word. So createTable / alterTable usually check these.
Referenced by ilDBPdo\setDBType().
ilDBInterface::getSequenceName | ( | $table_name | ) |
ilDBInterface::getStorageEngine | ( | ) |
Implemented in ilDBPdo, and ilDBPdoPostgreSQL.
ilDBInterface::groupConcat | ( | $a_field_name, | |
$a_seperator = "," , |
|||
$a_order = null |
|||
) |
string | $a_field_name | |
string | $a_seperator | |
string | $a_order |
Implemented in ilDBPdo.
ilDBInterface::in | ( | $field, | |
$values, | |||
$negate = false , |
|||
$type = "" |
|||
) |
$field | string | |
$values | array | |
bool | $negate | |
string | $type |
Implemented in ilDBPdo.
Referenced by ilRbacAdmin\assignUserLimited().
ilDBInterface::indexExistsByFields | ( | $table_name, | |
$fields | |||
) |
ilDBInterface::initFromIniFile | ( | $tmpClientIniFile = null | ) |
null | $tmpClientIniFile |
Implemented in ilDBPdo.
Referenced by ilDatabaseBaseTest\connect(), and ilDatabaseImplementationBaseTest\connect().
ilDBInterface::insert | ( | $table_name, | |
$values | |||
) |
$table_name | string |
$values |
Implemented in ilDBPdo.
Referenced by ilChangeEvent\_syncObjectStats(), and ilSessionStatistics\createNewAggregationSlot().
ilDBInterface::isFulltextIndex | ( | $a_table, | |
$a_name | |||
) |
|
static |
$a_word |
Implemented in ilDBPdo.
Referenced by ilDatabaseReservedWordsTest\testReservedPDO().
ilDBInterface::like | ( | $column, | |
$type, | |||
$value = "?" , |
|||
$case_insensitive = true |
|||
) |
Generate a like subquery.
string | $column | |
string | $type | |
mixed | $value | |
bool | $case_insensitive |
Implemented in ilDBPdo.
ilDBInterface::listSequences | ( | ) |
Implemented in ilDBPdo.
ilDBInterface::listTables | ( | ) |
Implemented in ilDBPdo.
Referenced by ilAtomQueryTestHelper\__invoke().
ilDBInterface::loadModule | ( | $module | ) |
ilDBInterface::locate | ( | $a_needle, | |
$a_string, | |||
$a_start_pos = 1 |
|||
) |
ilDBInterface::lockTables | ( | $tables | ) |
Abstraction of lock table.
array | table definitions |
Implemented in ilDBPdo, and ilDBPdoPostgreSQL.
ilDBInterface::lower | ( | $a_exp | ) |
ilDBInterface::manipulate | ( | $query | ) |
Run a (write) Query on the database.
The implementation MUST start and stop a $ilBench Database-Benchmark, e.g.:
$ilBench->startDbBench($sql); .... [run the query] $ilBench->stopDbBench();
$query | string |
Implemented in ilDBPdo.
Referenced by ilRbacAdmin\assignUserLimited(), ilGlossaryDefinition\create(), ilObjectActivation\createDefaultEntry(), ilGlossaryDefinition\delete(), ilWikiUserHTMLExport\getProcess(), ilGlossaryDefinition\moveDown(), ilGlossaryDefinition\moveUp(), ilDBUpdateNewObjectType\varchar2text(), and ilWikiStat\writeData().
ilDBInterface::manipulateF | ( | $query, | |
$types, | |||
$values | |||
) |
$query | string |
$types | string[] |
$values | mixed[] |
Implemented in ilDBPdo.
Referenced by ilForumTopic\movePosts().
ilDBInterface::modifyTableColumn | ( | $table, | |
$column, | |||
$attributes | |||
) |
ilDBInterface::nextId | ( | $table_name | ) |
$table_name | string |
Implemented in ilDBPdoPostgreSQL, ilDBPdo, and ilDBPdoMySQL.
ilDBInterface::now | ( | ) |
Implemented in ilDBPdo.
ilDBInterface::numRows | ( | $query_result | ) |
$query_result | PDOStatement |
Implemented in ilDBPdo.
Referenced by ilChangeEvent\_syncObjectStats(), ilObjectActivation\createDefaultEntry(), and ilWikiStat\writeData().
ilDBInterface::prepare | ( | $a_query, | |
$a_types = null , |
|||
$a_result_types = null |
|||
) |
Prepare a query (SELECT) statement to be used with execute.
string | $a_query |
Implemented in ilDBPdo, and ilDBPdoInterface.
ilDBInterface::prepareManip | ( | $a_query, | |
$a_types = null |
|||
) |
ilDBInterface::query | ( | $query | ) |
Run a (read-only) Query on the database.
The implementation MUST start and stop a $ilBench Database-Benchmark, e.g.:
$ilBench->startDbBench($sql); .... [run the query] $ilBench->stopDbBench();
$query | string |
Implemented in ilDBPdo.
Referenced by ilChangeEvent\_syncObjectStats(), ilRbacAdmin\assignUserLimited(), ilGlossaryDefinition\create(), ilObjectActivation\createDefaultEntry(), ilGlossaryDefinition\delete(), ilGlossaryDefinition\moveDown(), ilGlossaryDefinition\moveUp(), and ilWikiStat\writeData().
ilDBInterface::queryF | ( | $query, | |
$types, | |||
$values | |||
) |
$query | string |
$types | string[] |
$values | mixed[] |
Implemented in ilDBPdo.
Referenced by ilObjTestDynamicQuestionSetConfig\getPoolQuestionChangeListener().
ilDBInterface::quote | ( | $value, | |
$type | |||
) |
$value | |
$type |
Implemented in ilDBPdo.
Referenced by ilChangeEvent\_syncObjectStats(), ilRbacAdmin\assignUserLimited(), ilGlossaryDefinition\create(), ilObjectActivation\createDefaultEntry(), ilGlossaryDefinition\delete(), ilWikiUserHTMLExport\getProcess(), ilGlossaryDefinition\moveDown(), ilGlossaryDefinition\moveUp(), and ilWikiStat\writeData().
ilDBInterface::quoteIdentifier | ( | $identifier, | |
$check_option = false |
|||
) |
$identifier | ||
bool | $check_option |
Implemented in ilDBPdoPostgreSQL, and ilDBPdo.
ilDBInterface::renameTable | ( | $old_name, | |
$new_name | |||
) |
ilDBInterface::renameTableColumn | ( | $table_name, | |
$column_old_name, | |||
$column_new_name | |||
) |
$table_name | string |
$column_old_name | string |
$column_new_name | string |
Implemented in ilDBPdo.
Referenced by ilDBUpdateNewObjectType\varchar2text().
ilDBInterface::replace | ( | $table, | |
$primaryKeys, | |||
$otherColumns | |||
) |
Replace into method.
string | table name |
array | primary key values: array("field1" => array("text", $name), "field2" => ...) |
array | other values: array("field1" => array("text", $name), "field2" => ...) |
Implemented in ilDBPdo, and ilDBPdoPostgreSQL.
ilDBInterface::rollback | ( | ) |
ilDBInterface::sanitizeMB4StringIfNotSupported | ( | $query | ) |
$query | string to sanitize, all MB4-Characters like emojis will re replaced with ??? |
Implemented in ilDBPdo.
ilDBInterface::sequenceExists | ( | $sequence | ) |
ilDBInterface::setDBHost | ( | $host | ) |
$host |
Implemented in ilDBPdo.
ilDBInterface::setDBPassword | ( | $password | ) |
$password |
Implemented in ilDBPdo.
ilDBInterface::setDBPort | ( | $port | ) |
$port |
Implemented in ilDBPdo.
ilDBInterface::setDBUser | ( | $user | ) |
$user |
Implemented in ilDBPdo.
ilDBInterface::setLimit | ( | $limit, | |
$offset | |||
) |
$limit | |
$offset |
Implemented in ilDBPdo.
ilDBInterface::setStorageEngine | ( | $storage_engine | ) |
$storage_engine |
Implemented in ilDBPdo, and ilDBPdoPostgreSQL.
ilDBInterface::substr | ( | $a_exp | ) |
$a_exp |
ilDBInterface::supports | ( | $feature | ) |
ilDBInterface::supportsFulltext | ( | ) |
Implemented in ilDBPdo, ilDBPdoPostgreSQL, ilDBPdoMySQLInnoDB, and ilDBPdoMySQLMyISAM.
ilDBInterface::supportsSlave | ( | ) |
Implemented in ilDBPdo.
ilDBInterface::supportsTransactions | ( | ) |
Implemented in ilDBPdo, ilDBPdoPostgreSQL, ilDBPdoMySQLInnoDB, ilDBPdoMySQL, and ilDBPdoMySQLGalera.
ilDBInterface::tableColumnExists | ( | $table_name, | |
$column_name | |||
) |
$table_name | string |
$column_name | string |
Implemented in ilDBPdo, and ilDBPdoPostgreSQL.
ilDBInterface::tableExists | ( | $table_name | ) |
ilDBInterface::unlockTables | ( | ) |
Unlock tables locked by previous lock table calls.
Implemented in ilDBPdo, and ilDBPdoPostgreSQL.
ilDBInterface::update | ( | $table_name, | |
$values, | |||
$where | |||
) |
$table_name | string |
$values | array |
$where | array |
Implemented in ilDBPdo.
Referenced by ilChangeEvent\_syncObjectStats(), and ilLSStateDB\update().
ilDBInterface::upper | ( | $a_exp | ) |
ilDBInterface::useSlave | ( | $bool | ) |