ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
interface.ilDBInterface.php
Go to the documentation of this file.
1 <?php
2 
9 interface ilDBInterface {
10 
14  public function doesCollationSupportMB4Strings();
15 
21  public function sanitizeMB4StringIfNotSupported($query);
22 
29  static function getReservedWords();
30 
31 
35  public function initFromIniFile($tmpClientIniFile = null);
36 
37 
42  public function connect($return_false_on_error = false);
43 
44 
50  public function nextId($table_name);
51 
52 
60  public function createTable($table_name, $fields, $drop_table = false, $ignore_erros = false);
61 
62 
67  public function addPrimaryKey($table_name, $primary_keys);
68 
69 
74  public function createSequence($table_name, $start = 1);
75 
76 
81  public function getSequenceName($table_name);
82 
83 
89  public function tableExists($table_name);
90 
91 
98  public function tableColumnExists($table_name, $column_name);
99 
100 
106  public function addTableColumn($table_name, $column_name, $attributes);
107 
108 
114  public function dropTable($table_name, $error_if_not_existing = true);
115 
116 
123  public function renameTable($old_name, $new_name);
124 
125 
131  public function query($query);
132 
133 
139  public function fetchAll($query_result, $fetch_mode = ilDBConstants::FETCHMODE_ASSOC);
140 
141 
145  public function dropSequence($table_name);
146 
147 
152  public function dropTableColumn($table_name, $column_name);
153 
154 
160  public function renameTableColumn($table_name, $column_old_name, $column_new_name);
161 
162 
168  public function insert($table_name, $values);
169 
170 
176  public function fetchObject($query_result);
177 
178 
185  public function update($table_name, $values, $where);
186 
187 
192  public function manipulate($query);
193 
194 
200  public function fetchAssoc($query_result);
201 
202 
208  public function numRows($query_result);
209 
210 
217  public function quote($value, $type);
218 
219 
227  public function addIndex($table_name, $fields, $index_name = '', $fulltext = false);
228 
229 
236  public function indexExistsByFields($table_name, $fields);
237 
242  // public function fetchRow($fetchMode = ilDBConstants::FETCHMODE_ASSOC);
243 
247  public function getDSN();
248 
249 
253  public function getDBType();
254 
255 
263  public function lockTables($tables);
264 
265 
272  public function unlockTables();
273 
274 
282  public function in($field, $values, $negate = false, $type = "");
283 
284 
291  public function queryF($query, $types, $values);
292 
293 
300  public function manipulateF($query, $types, $values);
301 
302 
309  public function useSlave($bool);
310 
311 
316  public function setLimit($limit, $offset);
317 
318 
328  public function like($column, $type, $value = "?", $case_insensitive = true);
329 
330 
334  public function now();
335 
336 
344  public function replace($table, $primaryKeys, $otherColumns);
345 
346 
354  public function equals($columns, $value, $type, $emptyOrNull = false);
355 
356 
360  public function setDBUser($user);
361 
362 
366  public function setDBPort($port);
367 
368 
372  public function setDBPassword($password);
373 
374 
378  public function setDBHost($host);
379 
380 
385  public function upper($a_exp);
386 
387 
392  public function lower($a_exp);
393 
394 
399  public function substr($a_exp);
400 
401 
407  public function prepareManip($a_query, $a_types = null);
408 
409 
413  public function enableResultBuffering($a_status);
414 
415 
422  public function execute($stmt, $data = array());
423 
428  public function sequenceExists($sequence);
429 
430 
434  public function listSequences();
435 
436 
437 
438  //
439  // type-specific methods
440  //
441 
446  public function supports($feature);
447 
448 
452  public function supportsFulltext();
453 
454 
458  public function supportsSlave();
459 
460 
464  public function supportsTransactions();
465 
466  //
467  //
468  //
472  public function listTables();
473 
474 
479  public function loadModule($module);
480 
481 
485  public function getAllowedAttributes();
486 
487 
493  public function concat(array $values, $allow_null = true);
494 
495 
502  public function locate($a_needle, $a_string, $a_start_pos = 1);
503 
504 
510  public function quoteIdentifier($identifier, $check_option = false);
511 
512 
519  public function modifyTableColumn($table, $column, $attributes);
520 
521 
526  public function free($a_st);
527 
528 
533  public function checkTableName($a_name);
534 
535 
540  public static function isReservedWord($a_word);
541 
542 
547  public function beginTransaction();
548 
549 
554  public function commit();
555 
556 
561  public function rollback();
562 
563 
569  public function constraintName($a_table, $a_constraint);
570 
571 
577  public function dropIndex($a_table, $a_name = "i1");
578 
579 
586  public function createDatabase($a_name, $a_charset = "utf8", $a_collation = "");
587 
588 
594  public function dropIndexByFields($table_name, $afields);
595 
596 
600  public function getPrimaryKeyIdentifier();
601 
602 
609  public function addFulltextIndex($table_name, $afields, $a_name = 'in');
610 
611 
617  public function dropFulltextIndex($a_table, $a_name);
618 
619 
625  public function isFulltextIndex($a_table, $a_name);
626 
627 
631  public function setStorageEngine($storage_engine);
632 
633 
637  public function getStorageEngine();
638 
639 
643  public function buildAtomQuery();
644 
645 
652  public function groupConcat($a_field_name, $a_seperator = ",", $a_order = NULL);
653 
654 
660  public function cast($a_field_name, $a_dest_type);
661 
662 }
663 
667 interface ilDBPdoInterface extends ilDBInterface {
668 
673  public function getServerVersion($native = false);
674 
675 
682  public function queryCol($query, $type = ilDBConstants::FETCHMODE_DEFAULT, $colnum = 0);
683 
684 
691  public function queryRow($query, $types = null, $fetchmode = ilDBConstants::FETCHMODE_DEFAULT);
692 
693 
699  public function escape($value, $escape_wildcards = false);
700 
701 
706  public function escapePattern($text);
707 
708 
714  public function migrateAllTablesToEngine($engine = ilDBConstants::MYSQL_ENGINE_INNODB);
715 
716 
720  public function supportsEngineMigration();
721 
722 
728  public function migrateAllTablesToCollation($collation = ilDBConstants::MYSQL_COLLATION_UTF8MB4);
729 
730 
734  public function supportsCollationMigration();
735 
736 
743  public function addUniqueConstraint($table, $fields, $name = "con");
744 
745 
751  public function dropUniqueConstraint($table, $name = "con");
752 
753 
759  public function dropUniqueConstraintByFields($table, $fields);
760 
761 
766  public function checkIndexName($name);
767 
768 
772  public function getLastInsertId();
773 
774 
781  public function prepare($query, $types = null, $result_types = null);
782 
783 
789  public function uniqueConstraintExists($table, array $fields);
790 
791 
795  public function dropPrimaryKey($table_name);
796 
797 
802  public function executeMultiple($stmt, $data);
803 
804 
810  public function fromUnixtime($expr, $to_text = true);
811 
812 
816  public function unixTimestamp();
817 
818 
834  public function autoExecute($tablename, $fields, $mode = ilDBConstants::MDB2_AUTOQUERY_INSERT, $where = false);
835 
836 
842  public function getDBVersion();
843 }
prepareManip($a_query, $a_types=null)
initFromIniFile($tmpClientIniFile=null)
setDBUser($user)
modifyTableColumn($table, $column, $attributes)
static getReservedWords()
Get reserved words.
execute($stmt, $data=array())
locate($a_needle, $a_string, $a_start_pos=1)
addPrimaryKey($table_name, $primary_keys)
setLimit($limit, $offset)
isFulltextIndex($a_table, $a_name)
$engine
Definition: workflow.php:90
Interface ilDBPdoInterface.
connect($return_false_on_error=false)
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)
update($table_name, $values, $where)
enableResultBuffering($a_status)
upper($a_exp)
useSlave($bool)
Return false iff slave is not supported.
numRows($query_result)
concat(array $values, $allow_null=true)
Interface ilDBInterface.
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)
$column
Definition: 39dropdown.php:62
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)
groupConcat($a_field_name, $a_seperator=",", $a_order=NULL)
dropTableColumn($table_name, $column_name)
createDatabase($a_name, $a_charset="utf8", $a_collation="")
Create styles array
The data for the language used.
getDBType()
Get DSN.
fetchObject($query_result)
quoteIdentifier($identifier, $check_option=false)
setDBPassword($password)
dropIndex($a_table, $a_name="i1")
doesCollationSupportMB4Strings()
supports($feature)
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)
insert($table_name, $values)
fetchAssoc($query_result)
$text
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)
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)