ILIAS  release_8 Revision v8.24
interface.ilDBInterface.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
27{
28 public function doesCollationSupportMB4Strings(): bool;
29
34 public function sanitizeMB4StringIfNotSupported(string $query): string;
35
43 public static function getReservedWords(): array;
44
45 public function initFromIniFile(?ilIniFile $ini = null): void;
46
47 public function connect(bool $return_false_on_error = false): ?bool;
48
49 public function nextId(string $table_name): int;
50
51 public function createTable(
52 string $table_name,
53 array $fields,
54 bool $drop_table = false,
55 bool $ignore_erros = false
56 ): bool;
57
58 public function addPrimaryKey(string $table_name, array $primary_keys): bool;
59
60 public function createSequence(string $table_name, int $start = 1): bool;
61
62 public function getSequenceName(string $table_name): string;
63
64 public function tableExists(string $table_name): bool;
65
66 public function tableColumnExists(string $table_name, string $column_name): bool;
67
68 public function addTableColumn(string $table_name, string $column_name, array $attributes): bool;
69
70 public function dropTable(string $table_name, bool $error_if_not_existing = true): bool;
71
72 public function renameTable(string $old_name, string $new_name): bool;
73
77 public function query(string $query): ilDBStatement;
78
79 public function fetchAll(ilDBStatement $statement, int $fetch_mode = ilDBConstants::FETCHMODE_ASSOC): array;
80
81 public function dropSequence(string $table_name): bool;
82
83 public function dropTableColumn(string $table_name, string $column_name): bool;
84
85 public function renameTableColumn(string $table_name, string $column_old_name, string $column_new_name): bool;
86
90 public function insert(string $table_name, array $values): int;
91
92 public function fetchObject(ilDBStatement $query_result): ?stdClass;
93
99 public function update(string $table_name, array $values, array $where): int;
100
105 public function manipulate(string $query): int;
106
107 public function fetchAssoc(ilDBStatement $statement): ?array;
108
109 public function numRows(ilDBStatement $statement): int;
110
114 public function quote($value, string $type): string;
115
116 public function addIndex(string $table_name, array $fields, string $index_name = '', bool $fulltext = false): bool;
117
118 public function indexExistsByFields(string $table_name, array $fields): bool;
119
123 public function getDSN(): string;
124
128 public function getDBType(): string;
129
135 public function lockTables(array $tables): void;
136
141 public function unlockTables(): void;
142
143 public function in(string $field, array $values, bool $negate = false, string $type = ""): string;
144
148 public function queryF(string $query, array $types, array $values): ilDBStatement;
149
154 public function manipulateF(string $query, array $types, array $values): int;
155
159 public function useSlave(bool $bool): bool;
160
161 public function setLimit(int $limit, int $offset = 0): void;
162
166 public function like(string $column, string $type, string $value = "?", bool $case_insensitive = true): string;
167
171 public function now(): string;
172
180 public function replace(string $table, array $primary_keys, array $other_columns): int;
181
182 public function equals(string $columns, $value, string $type, bool $emptyOrNull = false): string;
183
184 public function setDBUser(string $user): void;
185
186 public function setDBPort(int $port): void;
187
188 public function setDBPassword(string $password): void;
189
190 public function setDBHost(string $host): void;
191
192 public function upper(string $expression): string;
193
194 public function lower(string $expression): string;
195
196 public function substr(string $expression): string;
197
201 public function prepare(string $a_query, array $a_types = null, array $a_result_types = null): ilDBStatement;
202
203 public function prepareManip(string $a_query, ?array $a_types = null): ilDBStatement;
204
205 public function enableResultBuffering(bool $a_status): void;
206
210 public function execute(ilDBStatement $stmt, array $data = []): ilDBStatement;
211
212 public function sequenceExists(string $sequence): bool;
213
217 public function listSequences(): array;
218
219 public function supports(string $feature): bool;
220
221 public function supportsFulltext(): bool;
222
223 public function supportsSlave(): bool;
224
225 public function supportsTransactions(): bool;
226
230 public function listTables(): array;
231
237 public function loadModule(string $module);
238
242 public function getAllowedAttributes(): array;
243
244 public function concat(array $values, bool $allow_null = true): string;
245
246 public function locate(string $needle, string $string, int $start_pos = 1): string;
247
248 public function quoteIdentifier(string $identifier, bool $check_option = false): string;
249
250 public function modifyTableColumn(string $table, string $column, array $attributes): bool;
251
252 public function free(ilDBStatement $a_st): void;
253
254 public function checkTableName(string $a_name): bool;
255
256 public static function isReservedWord(string $a_word): bool;
257
261 public function beginTransaction(): bool;
262
266 public function commit(): bool;
267
271 public function rollback(): bool;
272
273 public function constraintName(string $a_table, string $a_constraint): string;
274
275 public function dropIndex(string $a_table, string $a_name = "i1"): bool;
276
277 public function createDatabase(string $a_name, string $a_charset = "utf8", string $a_collation = ""): bool;
278
279 public function dropIndexByFields(string $table_name, array $afields): bool;
280
281 public function getPrimaryKeyIdentifier(): string;
282
283 public function addFulltextIndex(string $table_name, array $afields, string $a_name = 'in'): bool;
284
285 public function dropFulltextIndex(string $a_table, string $a_name): bool;
286
287 public function isFulltextIndex(string $a_table, string $a_name): bool;
288
289 public function setStorageEngine(string $storage_engine): void;
290
291 public function getStorageEngine(): string;
292
293 public function buildAtomQuery(): ilAtomQuery;
294
295 public function groupConcat(string $a_field_name, string $a_seperator = ",", ?string $a_order = null): string;
296
297 public function cast(string $a_field_name, string $a_dest_type): string;
298
299 public function primaryExistsByFields(string $table_name, array $fields): bool;
300}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilDBInterface.
addTableColumn(string $table_name, string $column_name, array $attributes)
lockTables(array $tables)
Abstraction of lock table.
useSlave(bool $bool)
checkTableName(string $a_name)
update(string $table_name, array $values, array $where)
@description $where MUST contain existing columns only.
dropFulltextIndex(string $a_table, string $a_name)
setStorageEngine(string $storage_engine)
setDBHost(string $host)
cast(string $a_field_name, string $a_dest_type)
addIndex(string $table_name, array $fields, string $index_name='', bool $fulltext=false)
addFulltextIndex(string $table_name, array $afields, string $a_name='in')
indexExistsByFields(string $table_name, array $fields)
insert(string $table_name, array $values)
concat(array $values, bool $allow_null=true)
quoteIdentifier(string $identifier, bool $check_option=false)
supports(string $feature)
dropTableColumn(string $table_name, string $column_name)
static getReservedWords()
Get reserved words.
prepare(string $a_query, array $a_types=null, array $a_result_types=null)
Prepare a query (SELECT) statement to be used with execute.
replace(string $table, array $primary_keys, array $other_columns)
Replace into method.
fetchObject(ilDBStatement $query_result)
sequenceExists(string $sequence)
nextId(string $table_name)
prepareManip(string $a_query, ?array $a_types=null)
execute(ilDBStatement $stmt, array $data=[])
constraintName(string $a_table, string $a_constraint)
connect(bool $return_false_on_error=false)
setLimit(int $limit, int $offset=0)
createDatabase(string $a_name, string $a_charset="utf8", string $a_collation="")
fetchAll(ilDBStatement $statement, int $fetch_mode=ilDBConstants::FETCHMODE_ASSOC)
primaryExistsByFields(string $table_name, array $fields)
groupConcat(string $a_field_name, string $a_seperator=",", ?string $a_order=null)
like(string $column, string $type, string $value="?", bool $case_insensitive=true)
Generate a like subquery.
isFulltextIndex(string $a_table, string $a_name)
getDSN()
Get DSN.
getSequenceName(string $table_name)
numRows(ilDBStatement $statement)
equals(string $columns, $value, string $type, bool $emptyOrNull=false)
quote($value, string $type)
setDBPort(int $port)
tableExists(string $table_name)
manipulate(string $query)
Run a (write) Query on the database.
manipulateF(string $query, array $types, array $values)
setDBPassword(string $password)
sanitizeMB4StringIfNotSupported(string $query)
getDBType()
Get DSN.
dropTable(string $table_name, bool $error_if_not_existing=true)
locate(string $needle, string $string, int $start_pos=1)
query(string $query)
Run a (read-only) Query on the database.
tableColumnExists(string $table_name, string $column_name)
fetchAssoc(ilDBStatement $statement)
queryF(string $query, array $types, array $values)
dropIndexByFields(string $table_name, array $afields)
dropIndex(string $a_table, string $a_name="i1")
free(ilDBStatement $a_st)
getPrimaryKeyIdentifier()
createTable(string $table_name, array $fields, bool $drop_table=false, bool $ignore_erros=false)
setDBUser(string $user)
lower(string $expression)
renameTable(string $old_name, string $new_name)
renameTableColumn(string $table_name, string $column_old_name, string $column_new_name)
modifyTableColumn(string $table, string $column, array $attributes)
addPrimaryKey(string $table_name, array $primary_keys)
in(string $field, array $values, bool $negate=false, string $type="")
doesCollationSupportMB4Strings()
enableResultBuffering(bool $a_status)
substr(string $expression)
createSequence(string $table_name, int $start=1)
initFromIniFile(?ilIniFile $ini=null)
dropSequence(string $table_name)
static isReservedWord(string $a_word)
upper(string $expression)
loadModule(string $module)
unlockTables()
Unlock tables locked by previous lock table calls.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$attributes
Definition: metadata.php:248
$query
$type
$ini
Definition: raiseError.php:4