ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
interface.ilDBInterface.php
Go to the documentation of this file.
1 <?php
2 
9 interface ilDBInterface
10 {
11 
15  public function doesCollationSupportMB4Strings();
16 
22  public function sanitizeMB4StringIfNotSupported($query);
23 
30  public static function getReservedWords();
31 
32 
36  public function initFromIniFile($tmpClientIniFile = null);
37 
38 
43  public function connect($return_false_on_error = false);
44 
45 
51  public function nextId($table_name);
52 
53 
61  public function createTable($table_name, $fields, $drop_table = false, $ignore_erros = false);
62 
63 
68  public function addPrimaryKey($table_name, $primary_keys);
69 
70 
75  public function createSequence($table_name, $start = 1);
76 
77 
82  public function getSequenceName($table_name);
83 
84 
90  public function tableExists($table_name);
91 
92 
99  public function tableColumnExists($table_name, $column_name);
100 
101 
107  public function addTableColumn($table_name, $column_name, $attributes);
108 
109 
115  public function dropTable($table_name, $error_if_not_existing = true);
116 
117 
124  public function renameTable($old_name, $new_name);
125 
126 
140  public function query($query);
141 
142 
148  public function fetchAll($query_result, $fetch_mode = ilDBConstants::FETCHMODE_ASSOC);
149 
150 
154  public function dropSequence($table_name);
155 
156 
161  public function dropTableColumn($table_name, $column_name);
162 
163 
169  public function renameTableColumn($table_name, $column_old_name, $column_new_name);
170 
171 
177  public function insert($table_name, $values);
178 
179 
185  public function fetchObject($query_result);
186 
187 
194  public function update($table_name, $values, $where);
195 
196 
209  public function manipulate($query);
210 
211 
217  public function fetchAssoc($query_result);
218 
219 
225  public function numRows($query_result);
226 
227 
234  public function quote($value, $type);
235 
236 
244  public function addIndex($table_name, $fields, $index_name = '', $fulltext = false);
245 
246 
253  public function indexExistsByFields($table_name, $fields);
254 
259  // public function fetchRow($fetchMode = ilDBConstants::FETCHMODE_ASSOC);
260 
264  public function getDSN();
265 
266 
270  public function getDBType();
271 
272 
280  public function lockTables($tables);
281 
282 
289  public function unlockTables();
290 
291 
299  public function in($field, $values, $negate = false, $type = "");
300 
301 
308  public function queryF($query, $types, $values);
309 
310 
317  public function manipulateF($query, $types, $values);
318 
319 
326  public function useSlave($bool);
327 
328 
333  public function setLimit($limit, $offset);
334 
335 
345  public function like($column, $type, $value = "?", $case_insensitive = true);
346 
347 
351  public function now();
352 
353 
361  public function replace($table, $primaryKeys, $otherColumns);
362 
363 
371  public function equals($columns, $value, $type, $emptyOrNull = false);
372 
373 
377  public function setDBUser($user);
378 
379 
383  public function setDBPort($port);
384 
385 
389  public function setDBPassword($password);
390 
391 
395  public function setDBHost($host);
396 
397 
402  public function upper($a_exp);
403 
404 
409  public function lower($a_exp);
410 
411 
416  public function substr($a_exp);
417 
425  public function prepare($a_query, $a_types = null, $a_result_types = null);
426 
427 
433  public function prepareManip($a_query, $a_types = null);
434 
435 
439  public function enableResultBuffering($a_status);
440 
441 
448  public function execute($stmt, $data = array());
449 
454  public function sequenceExists($sequence);
455 
456 
460  public function listSequences();
461 
462 
463 
464  //
465  // type-specific methods
466  //
467 
472  public function supports($feature);
473 
474 
478  public function supportsFulltext();
479 
480 
484  public function supportsSlave();
485 
486 
490  public function supportsTransactions();
491 
492  //
493  //
494  //
498  public function listTables();
499 
500 
508  public function loadModule($module);
509 
510 
514  public function getAllowedAttributes();
515 
516 
522  public function concat(array $values, $allow_null = true);
523 
524 
531  public function locate($a_needle, $a_string, $a_start_pos = 1);
532 
533 
539  public function quoteIdentifier($identifier, $check_option = false);
540 
541 
548  public function modifyTableColumn($table, $column, $attributes);
549 
550 
555  public function free($a_st);
556 
557 
562  public function checkTableName($a_name);
563 
564 
569  public static function isReservedWord($a_word);
570 
571 
576  public function beginTransaction();
577 
578 
583  public function commit();
584 
585 
590  public function rollback();
591 
592 
598  public function constraintName($a_table, $a_constraint);
599 
600 
606  public function dropIndex($a_table, $a_name = "i1");
607 
608 
615  public function createDatabase($a_name, $a_charset = "utf8", $a_collation = "");
616 
617 
623  public function dropIndexByFields($table_name, $afields);
624 
625 
629  public function getPrimaryKeyIdentifier();
630 
631 
638  public function addFulltextIndex($table_name, $afields, $a_name = 'in');
639 
640 
646  public function dropFulltextIndex($a_table, $a_name);
647 
648 
654  public function isFulltextIndex($a_table, $a_name);
655 
656 
660  public function setStorageEngine($storage_engine);
661 
662 
666  public function getStorageEngine();
667 
668 
672  public function buildAtomQuery();
673 
674 
681  public function groupConcat($a_field_name, $a_seperator = ",", $a_order = null);
682 
683 
689  public function cast($a_field_name, $a_dest_type);
690 }
691 
696 {
697 
702  public function getServerVersion($native = false);
703 
704 
711  public function queryCol($query, $type = ilDBConstants::FETCHMODE_DEFAULT, $colnum = 0);
712 
713 
720  public function queryRow($query, $types = null, $fetchmode = ilDBConstants::FETCHMODE_DEFAULT);
721 
722 
728  public function escape($value, $escape_wildcards = false);
729 
730 
735  public function escapePattern($text);
736 
737 
743  public function migrateAllTablesToEngine($engine = ilDBConstants::MYSQL_ENGINE_INNODB);
744 
745 
749  public function supportsEngineMigration();
750 
751 
757  public function migrateAllTablesToCollation($collation = ilDBConstants::MYSQL_COLLATION_UTF8MB4);
758 
759 
763  public function supportsCollationMigration();
764 
765 
772  public function addUniqueConstraint($table, $fields, $name = "con");
773 
774 
780  public function dropUniqueConstraint($table, $name = "con");
781 
782 
788  public function dropUniqueConstraintByFields($table, $fields);
789 
790 
795  public function checkIndexName($name);
796 
797 
801  public function getLastInsertId();
802 
803 
810  public function prepare($query, $types = null, $result_types = null);
811 
812 
818  public function uniqueConstraintExists($table, array $fields);
819 
820 
824  public function dropPrimaryKey($table_name);
825 
826 
831  public function executeMultiple($stmt, $data);
832 
833 
839  public function fromUnixtime($expr, $to_text = true);
840 
841 
845  public function unixTimestamp();
846 
847 
863  public function autoExecute($tablename, $fields, $mode = ilDBConstants::MDB2_AUTOQUERY_INSERT, $where = false);
864 
865 
871  public function getDBVersion();
872 }
prepareManip($a_query, $a_types=null)
initFromIniFile($tmpClientIniFile=null)
setDBUser($user)
modifyTableColumn($table, $column, $attributes)
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)
$engine
Definition: workflow.php:89
Interface ilDBPdoInterface.
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)
$attributes
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.
if($modEnd===false) $module
Definition: module.php:59
numRows($query_result)
concat(array $values, $allow_null=true)
Interface ilDBInterface.
addIndex($table_name, $fields, $index_name='', $fulltext=false)
$password
Definition: pwgen.php:17
getDSN()
Get DSN.
nextId($table_name)
dropTable($table_name, $error_if_not_existing=true)
if($format !==null) $name
Definition: metadata.php:146
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)
$text
Definition: errorreport.php:18
lockTables($tables)
Abstraction of lock table.
queryF($query, $types, $values)
$query
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)
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)
if(empty($password)) $table
Definition: pwgen.php:24
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)