MydbInterface
extends
EncoderInterface, CommandInterface, QueryInterface, DataManipulationStatementsInterface, TransactionInterface, AdministrationStatementsInterface
in
Tags
Table of Contents
Methods
- beginTransaction() : void
- command() : bool
- Execute any SQL command, without returning result
- commitTransaction() : void
- delete() : int|null
- deleteWhere() : int|null
- escape() : string
- Escape value for the SQL query
- getEnumValues() : array<string|int, string>
- getPrimaryKeys() : array<string|int, string>|null
- Get table primary keys
- insert() : string|null
- insertMany() : void
- insertOne() : string|null
- query() : array<string|int, mixed>|null
- replace() : string|null
- replaceOne() : string|null
- rollbackTransaction() : void
- select() : array<string|int, mixed>|null
- update() : int|null
- updateWhere() : int|null
- updateWhereMany() : void
Methods
beginTransaction()
public
beginTransaction() : void
command()
Execute any SQL command, without returning result
public
command(string $query) : bool
Parameters
- $query : string
-
sql command
Return values
bool —true success or false on failure
commitTransaction()
public
commitTransaction() : void
delete()
public
delete(string $query) : int|null
Parameters
- $query : string
Return values
int|nulldeleteWhere()
public
deleteWhere(array<string|int, mixed> $whereFields, string $table[, array<string|int, mixed> $whereNotFields = [] ]) : int|null
Parameters
- $whereFields : array<string|int, mixed>
- $table : string
- $whereNotFields : array<string|int, mixed> = []
Return values
int|nullescape()
Escape value for the SQL query
public
escape(float|int|string|MydbExpressionInterface|null $unescaped[, string $quote = "'" ]) : string
Parameters
- $unescaped : float|int|string|MydbExpressionInterface|null
- $quote : string = "'"
Return values
stringgetEnumValues()
public
getEnumValues(string $table, string $column) : array<string|int, string>
Parameters
- $table : string
- $column : string
Return values
array<string|int, string>getPrimaryKeys()
Get table primary keys
public
getPrimaryKeys(string $table) : array<string|int, string>|null
Parameters
- $table : string
Return values
array<string|int, string>|nullinsert()
public
insert(string $query) : string|null
Parameters
- $query : string
Return values
string|nullinsertMany()
public
insertMany(array<string|int, mixed> $data, array<string|int, string> $cols, string $table[, bool $ignore = false ][, string $onDuplicateSql = '' ]) : void
Parameters
- $data : array<string|int, mixed>
- $cols : array<string|int, string>
- $table : string
- $ignore : bool = false
- $onDuplicateSql : string = ''
Tags
insertOne()
public
insertOne(array<string, float|int|MydbExpressionInterface|string|null> $data, string $table) : string|null
Parameters
- $data : array<string, float|int|MydbExpressionInterface|string|null>
- $table : string
Return values
string|nullquery()
public
query(string $query) : array<string|int, mixed>|null
Parameters
- $query : string
Tags
Return values
array<string|int, mixed>|nullreplace()
public
replace(string $query) : string|null
Parameters
- $query : string
Return values
string|nullreplaceOne()
public
replaceOne(array<string, float|int|MydbExpressionInterface|string|null> $data, string $table) : string|null
Parameters
- $data : array<string, float|int|MydbExpressionInterface|string|null>
- $table : string
Return values
string|nullrollbackTransaction()
public
rollbackTransaction() : void
select()
public
select(string $query) : array<string|int, mixed>|null
Parameters
- $query : string
Return values
array<string|int, mixed>|nullupdate()
public
update(string $query) : int|null
Parameters
- $query : string
Return values
int|nullupdateWhere()
public
updateWhere(array<string, float|int|string|MydbExpressionInterface|null> $update, array<string|int, mixed> $whereFields, string $table[, array<string|int, mixed> $whereNotFields = [] ]) : int|null
Parameters
- $update : array<string, float|int|string|MydbExpressionInterface|null>
- $whereFields : array<string|int, mixed>
- $table : string
- $whereNotFields : array<string|int, mixed> = []
Return values
int|nullupdateWhereMany()
public
updateWhereMany(array<string|int, mixed> $columnSetWhere, array<string|int, mixed> $where, string $table) : void
Parameters
- $columnSetWhere : array<string|int, mixed>
- $where : array<string|int, mixed>
- $table : string