ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
interface.ilDBInterface.php
Go to the documentation of this file.
1 <?php
2 
25 interface ilDBInterface
26 {
27 
31  public function doesCollationSupportMB4Strings();
32 
38  public function sanitizeMB4StringIfNotSupported($query);
39 
46  public static function getReservedWords();
47 
48 
52  public function initFromIniFile($tmpClientIniFile = null);
53 
54 
59  public function connect($return_false_on_error = false);
60 
61 
67  public function nextId($table_name);
68 
69 
77  public function createTable($table_name, $fields, $drop_table = false, $ignore_erros = false);
78 
79 
84  public function addPrimaryKey($table_name, $primary_keys);
85 
86 
91  public function createSequence($table_name, $start = 1);
92 
93 
98  public function getSequenceName($table_name);
99 
100 
106  public function tableExists($table_name);
107 
108 
115  public function tableColumnExists($table_name, $column_name);
116 
117 
123  public function addTableColumn($table_name, $column_name, $attributes);
124 
125 
131  public function dropTable($table_name, $error_if_not_existing = true);
132 
133 
140  public function renameTable($old_name, $new_name);
141 
142 
156  public function query($query);
157 
158 
164  public function fetchAll($query_result, $fetch_mode = ilDBConstants::FETCHMODE_ASSOC);
165 
166 
170  public function dropSequence($table_name);
171 
172 
177  public function dropTableColumn($table_name, $column_name);
178 
179 
185  public function renameTableColumn($table_name, $column_old_name, $column_new_name);
186 
187 
193  public function insert($table_name, $values);
194 
195 
201  public function fetchObject($query_result);
202 
203 
213  public function update($table_name, $values, $where);
214 
215 
228  public function manipulate($query);
229 
230 
236  public function fetchAssoc($query_result);
237 
238 
244  public function numRows($query_result);
245 
246 
253  public function quote($value, $type);
254 
255 
263  public function addIndex($table_name, $fields, $index_name = '', $fulltext = false);
264 
265 
272  public function indexExistsByFields($table_name, $fields);
273 
278  // public function fetchRow($fetchMode = ilDBConstants::FETCHMODE_ASSOC);
279 
283  public function getDSN();
284 
285 
289  public function getDBType();
290 
291 
299  public function lockTables($tables);
300 
301 
308  public function unlockTables();
309 
310 
318  public function in($field, $values, $negate = false, $type = "");
319 
320 
327  public function queryF($query, $types, $values);
328 
329 
336  public function manipulateF($query, $types, $values);
337 
338 
345  public function useSlave($bool);
346 
347 
352  public function setLimit($limit, $offset);
353 
354 
364  public function like($column, $type, $value = "?", $case_insensitive = true);
365 
366 
370  public function now();
371 
372 
380  public function replace($table, $primaryKeys, $otherColumns);
381 
382 
390  public function equals($columns, $value, $type, $emptyOrNull = false);
391 
392 
396  public function setDBUser($user);
397 
398 
402  public function setDBPort($port);
403 
404 
408  public function setDBPassword($password);
409 
410 
414  public function setDBHost($host);
415 
416 
421  public function upper($a_exp);
422 
423 
428  public function lower($a_exp);
429 
430 
435  public function substr($a_exp);
436 
444  public function prepare($a_query, $a_types = null, $a_result_types = null);
445 
446 
452  public function prepareManip($a_query, $a_types = null);
453 
454 
458  public function enableResultBuffering($a_status);
459 
460 
467  public function execute($stmt, $data = array());
468 
473  public function sequenceExists($sequence);
474 
475 
479  public function listSequences();
480 
481 
482 
483  //
484  // type-specific methods
485  //
486 
491  public function supports($feature);
492 
493 
497  public function supportsFulltext();
498 
499 
503  public function supportsSlave();
504 
505 
509  public function supportsTransactions();
510 
511  //
512  //
513  //
517  public function listTables();
518 
519 
527  public function loadModule($module);
528 
529 
533  public function getAllowedAttributes();
534 
535 
541  public function concat(array $values, $allow_null = true);
542 
543 
550  public function locate($a_needle, $a_string, $a_start_pos = 1);
551 
552 
558  public function quoteIdentifier($identifier, $check_option = false);
559 
560 
567  public function modifyTableColumn($table, $column, $attributes);
568 
569 
574  public function free($a_st);
575 
576 
581  public function checkTableName($a_name);
582 
583 
588  public static function isReservedWord($a_word);
589 
590 
595  public function beginTransaction();
596 
597 
602  public function commit();
603 
604 
609  public function rollback();
610 
611 
617  public function constraintName($a_table, $a_constraint);
618 
619 
625  public function dropIndex($a_table, $a_name = "i1");
626 
627 
634  public function createDatabase($a_name, $a_charset = "utf8", $a_collation = "");
635 
636 
642  public function dropIndexByFields($table_name, $afields);
643 
644 
648  public function getPrimaryKeyIdentifier();
649 
650 
657  public function addFulltextIndex($table_name, $afields, $a_name = 'in');
658 
659 
665  public function dropFulltextIndex($a_table, $a_name);
666 
667 
673  public function isFulltextIndex($a_table, $a_name);
674 
675 
679  public function setStorageEngine($storage_engine);
680 
681 
685  public function getStorageEngine();
686 
687 
691  public function buildAtomQuery();
692 
693 
700  public function groupConcat($a_field_name, $a_seperator = ",", $a_order = null);
701 
702 
708  public function cast($a_field_name, $a_dest_type);
709 
715  public function primaryExistsByFields(string $table_name, array $fields) : bool;
716 }
prepareManip($a_query, $a_types=null)
initFromIniFile($tmpClientIniFile=null)
$attributes
Definition: metadata.php:231
setDBUser($user)
modifyTableColumn($table, $column, $attributes)
$data
Definition: storeScorm.php:23
static getReservedWords()
Get reserved words.
execute($stmt, $data=array())
$type
locate($a_needle, $a_string, $a_start_pos=1)
addPrimaryKey($table_name, $primary_keys)
setLimit($limit, $offset)
isFulltextIndex($a_table, $a_name)
connect($return_false_on_error=false)
prepare($a_query, $a_types=null, $a_result_types=null)
Prepare a query (SELECT) statement to be used with execute.
getPrimaryKeyIdentifier()
renameTable($old_name, $new_name)
replace($table, $primaryKeys, $otherColumns)
Replace into method.
constraintName($a_table, $a_constraint)
in($field, $values, $negate=false, $type="")
sequenceExists($sequence)
substr($a_exp)
createSequence($table_name, $start=1)
checkTableName($a_name)
primaryExistsByFields(string $table_name, array $fields)
update($table_name, $values, $where)
$where MUST contain existing columns only.
enableResultBuffering($a_status)
upper($a_exp)
useSlave($bool)
Return false iff slave is not supported.
numRows($query_result)
concat(array $values, $allow_null=true)
addIndex($table_name, $fields, $index_name='', $fulltext=false)
getDSN()
Get DSN.
nextId($table_name)
dropTable($table_name, $error_if_not_existing=true)
quote($value, $type)
setStorageEngine($storage_engine)
getSequenceName($table_name)
cast($a_field_name, $a_dest_type)
tableExists($table_name)
equals($columns, $value, $type, $emptyOrNull=false)
lockTables($tables)
Abstraction of lock table.
queryF($query, $types, $values)
$query
dropTableColumn($table_name, $column_name)
createDatabase($a_name, $a_charset="utf8", $a_collation="")
getDBType()
Get DSN.
fetchObject($query_result)
quoteIdentifier($identifier, $check_option=false)
setDBPassword($password)
dropIndex($a_table, $a_name="i1")
doesCollationSupportMB4Strings()
supports($feature)
$password
Definition: cron.php:14
static isReservedWord($a_word)
indexExistsByFields($table_name, $fields)
unlockTables()
Unlock tables locked by previous lock table calls.
tableColumnExists($table_name, $column_name)
setDBPort($port)
sanitizeMB4StringIfNotSupported($query)
query($query)
Run a (read-only) Query on the database.
insert($table_name, $values)
fetchAssoc($query_result)
addTableColumn($table_name, $column_name, $attributes)
dropSequence($table_name)
loadModule($module)
like($column, $type, $value="?", $case_insensitive=true)
Generate a like subquery.
addFulltextIndex($table_name, $afields, $a_name='in')
if(! $in) $columns
Definition: Utf8Test.php:45
manipulateF($query, $types, $values)
createTable($table_name, $fields, $drop_table=false, $ignore_erros=false)
manipulate($query)
Run a (write) Query on the database.
groupConcat($a_field_name, $a_seperator=",", $a_order=null)
fetchAll($query_result, $fetch_mode=ilDBConstants::FETCHMODE_ASSOC)
renameTableColumn($table_name, $column_old_name, $column_new_name)
setDBHost($host)
dropIndexByFields($table_name, $afields)
lower($a_exp)
dropFulltextIndex($a_table, $a_name)