ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
interface.ilDBInterface.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
23
30{
31 public function doesCollationSupportMB4Strings(): bool;
32
37 public function sanitizeMB4StringIfNotSupported(string $query): string;
38
46 public static function getReservedWords(): array;
47
48 public function initFromIniFile(?ilIniFile $ini = null): void;
49
50 public function connect(bool $return_false_on_error = false): ?bool;
51
52 public function nextId(string $table_name): int;
53
54 public function createTable(
55 string $table_name,
56 array $fields,
57 bool $drop_table = false,
58 bool $ignore_erros = false
59 ): bool;
60
61 public function addPrimaryKey(string $table_name, array $primary_keys): bool;
62
63 public function createSequence(string $table_name, int $start = 1): bool;
64
65 public function getSequenceName(string $table_name): string;
66
67 public function tableExists(string $table_name): bool;
68
69 public function tableColumnExists(string $table_name, string $column_name): bool;
70
71 public function addTableColumn(string $table_name, string $column_name, array $attributes): bool;
72
73 public function dropTable(string $table_name, bool $error_if_not_existing = true): bool;
74
75 public function renameTable(string $old_name, string $new_name): bool;
76
80 public function query(string $query): ilDBStatement;
81
82 public function fetchAll(ilDBStatement $statement, int $fetch_mode = ilDBConstants::FETCHMODE_ASSOC): array;
83
84 public function dropSequence(string $table_name): bool;
85
86 public function dropTableColumn(string $table_name, string $column_name): bool;
87
88 public function renameTableColumn(string $table_name, string $column_old_name, string $column_new_name): bool;
89
93 public function insert(string $table_name, array $values): int;
94
95 public function fetchObject(ilDBStatement $query_result): ?stdClass;
96
102 public function update(string $table_name, array $values, array $where): int;
103
108 public function manipulate(string $query): int;
109
110 public function fetchAssoc(ilDBStatement $statement): ?array;
111
112 public function numRows(ilDBStatement $statement): int;
113
117 public function quote($value, string $type): string;
118
119 public function addIndex(string $table_name, array $fields, string $index_name = '', bool $fulltext = false): bool;
120
121 public function indexExistsByFields(string $table_name, array $fields): bool;
122
126 public function getDSN(): string;
127
131 public function getDBType(): string;
132
138 public function lockTables(array $tables): void;
139
144 public function unlockTables(): void;
145
146 public function in(string $field, array $values, bool $negate = false, string $type = ""): string;
147
151 public function queryF(string $query, array $types, array $values): ilDBStatement;
152
157 public function manipulateF(string $query, array $types, array $values): int;
158
162 public function useSlave(bool $bool): bool;
163
164 public function setLimit(int $limit, int $offset = 0): void;
165
169 public function like(string $column, string $type, string $value = "?", bool $case_insensitive = true): string;
170
174 public function now(): string;
175
183 public function replace(string $table, array $primary_keys, array $other_columns): int;
184
185 public function equals(string $columns, $value, string $type, bool $emptyOrNull = false): string;
186
187 public function setDBUser(string $user): void;
188
189 public function setDBPort(int $port): void;
190
191 public function setDBPassword(string $password): void;
192
193 public function setDBHost(string $host): void;
194
195 public function upper(string $expression): string;
196
197 public function lower(string $expression): string;
198
199 public function substr(string $expression): string;
200
204 public function prepare(string $a_query, ?array $a_types = null, ?array $a_result_types = null): ilDBStatement;
205
206 public function prepareManip(string $a_query, ?array $a_types = null): ilDBStatement;
207
208 public function enableResultBuffering(bool $a_status): void;
209
213 public function execute(ilDBStatement $stmt, array $data = []): ilDBStatement;
214
215 public function sequenceExists(string $sequence): bool;
216
220 public function listSequences(): array;
221
222 public function supports(string $feature): bool;
223
224 public function supportsFulltext(): bool;
225
226 public function supportsSlave(): bool;
227
228 public function supportsTransactions(): bool;
229
233 public function listTables(): array;
234
240 public function loadModule(string $module);
241
245 public function getAllowedAttributes(): array;
246
247 public function concat(array $values, bool $allow_null = true): string;
248
249 public function locate(string $needle, string $string, int $start_pos = 1): string;
250
251 public function quoteIdentifier(string $identifier, bool $check_option = false): string;
252
253 public function modifyTableColumn(string $table, string $column, array $attributes): bool;
254
255 public function free(ilDBStatement $a_st): void;
256
257 public function checkTableName(string $a_name): bool;
258
259 public static function isReservedWord(string $a_word): bool;
260
264 public function beginTransaction(): bool;
265
269 public function commit(): bool;
270
274 public function rollback(): bool;
275
276 public function constraintName(string $a_table, string $a_constraint): string;
277
278 public function dropIndex(string $a_table, string $a_name = "i1"): bool;
279
280 public function createDatabase(string $a_name, string $a_charset = "utf8", string $a_collation = ""): bool;
281
282 public function dropIndexByFields(string $table_name, array $afields): bool;
283
284 public function getPrimaryKeyIdentifier(): string;
285
286 public function addFulltextIndex(string $table_name, array $afields, string $a_name = 'in'): bool;
287
288 public function dropFulltextIndex(string $a_table, string $a_name): bool;
289
290 public function isFulltextIndex(string $a_table, string $a_name): bool;
291
292 public function setStorageEngine(string $storage_engine): void;
293
294 public function getStorageEngine(): string;
295
296 public function buildAtomQuery(): ilAtomQuery;
297
298 public function groupConcat(string $a_field_name, string $a_seperator = ",", ?string $a_order = null): string;
299
300 public function cast(string $a_field_name, string $a_dest_type): string;
301
306 public function addForeignKey(
307 string $foreign_key_name,
308 array $field_names,
309 string $table_name,
310 array $reference_field_names,
311 string $reference_table,
312 ?ForeignKeyConstraints $on_update = null,
313 ?ForeignKeyConstraints $on_delete = null
314 ): bool;
315
316 public function dropForeignKey(string $foreign_key_name, string $table_name): bool;
317
318 public function foreignKeyExists(string $foreign_key_name, string $table_name): bool;
319
321
322 public function primaryExistsByFields(string $table_name, array $fields): bool;
323}
INIFile Parser Early access in init proceess! Avoid further dependencies like logging or other servic...
Interface ilAtomQuery Use ilAtomQuery to fire Database-Actions which have to be done without beeing i...
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.
addForeignKey(string $foreign_key_name, array $field_names, string $table_name, array $reference_field_names, string $reference_table, ?ForeignKeyConstraints $on_update=null, ?ForeignKeyConstraints $on_delete=null)
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="")
prepare(string $a_query, ?array $a_types=null, ?array $a_result_types=null)
Prepare a query (SELECT) statement to be used with execute.
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)
dropForeignKey(string $foreign_key_name, string $table_name)
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)
foreignKeyExists(string $foreign_key_name, string $table_name)
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)
buildIntegrityAnalyser()
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.
Interface ilDBStatement.
$ini
Definition: raiseError.php:20