vB_dB_MYSQL_Assertor
extends vB_dB_Assertor
in package
Table of Contents
Methods
- __serialize() : array<string|int, mixed>
- __sleep() : array<string|int, mixed>
- __unserialize() : void
- __wakeup() : void
- affected_rows() : mixed
- assertQuery() : mixed
- Core function- validates, composes, and executes a query. See above for more
- beginTransaction() : mixed
- Standard transaction handler. Needs to be implemented in the child
- commitTransaction() : mixed
- Standard transaction handler. Needs to be implemented in the child
- debugDisplayNextQuerySql() : mixed
- Causes the SQL for the next query that is exectuted to be displayed for debugging purposes. This only works if debug mode is turned on
- delete() : mixed
- Table-based delete
- escape_string() : mixed
- This function is deprecated and will be removed. Do not use it.
- executeShutdownQueries() : mixed
- fetchTableStructure() : array<string|int, mixed>
- This gets the structure of a specific table. Used initially for complex queries
- getColumn() : array<string|int, mixed>
- Returns only one table field for all rows for a select query, either a defined query or table-based query.
- getDbCharsets() : array<string|int, mixed>
- Returns the charset for the database, and optionally also for the given table and column.
- getDBConnection() : mixed
- Gets the raw database connection object. This is solely implemented as a temporary measure to support legacy code. Do not use it without checking with the dev lead.
- getDbType() : mixed
- getField() : mixed
- Retrieves the first column of the first row for a select query (either defined or table-based)
- getForceSqlMode() : mixed
- getNoForceSqlMode() : mixed
- getQryCount() : array<string|int, mixed>
- This returns the performance data
- getRow() : array<string|int, mixed>
- Retrieves the first row for a select query either (defined or table-based)
- getRows() : array<string|int, mixed>
- Returns all rows for a select query, either a defined query or table-based query.
- hide_errors() : mixed
- Switches database error display OFF
- init() : mixed
- This sets the db. It will normally be called in the boot process
- insert() : mixed
- Table-based insert
- insertIgnore() : mixed
- Table-based insert ignore
- insertMultiple() : mixed
- Table-based multiple insert
- instance() : mixed
- returns the singleton instance
- inTransaction() : bool
- Standard transaction handler. Needs to be implemented in the child
- replace() : mixed
- Table-based replace query
- rollbackTransaction() : mixed
- Standard transaction handler. Needs to be implemented in the child
- select() : vB_dB_Result
- Table-based select
- show_errors() : mixed
- Switches database error display ON
- shutdownQuery() : bool
- Registers a query to be executed at shutdown time. If shutdown functions are disabled, the query is run immediately.
- skipShutdown() : mixed
- Disable the shutdown queries. Primarily reduces contention for session table.
- unregisterShutdownQuery() : mixed
- update() : mixed
- Table-based update
Methods
__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>__unserialize()
public
__unserialize(array<string|int, mixed> $serialized) : void
Parameters
- $serialized : array<string|int, mixed>
__wakeup()
public
__wakeup() : void
affected_rows()
public
affected_rows() : mixed
assertQuery()
Core function- validates, composes, and executes a query. See above for more
public
assertQuery(mixed $queryid[, mixed $params = [] ][, mixed $orderby = false ]) : mixed
Parameters
- $queryid : mixed
- $params : mixed = []
- $orderby : mixed = false
Return values
mixed —boolean, integer, or results object
beginTransaction()
Standard transaction handler. Needs to be implemented in the child
public
beginTransaction() : mixed
commitTransaction()
Standard transaction handler. Needs to be implemented in the child
public
commitTransaction() : mixed
debugDisplayNextQuerySql()
Causes the SQL for the next query that is exectuted to be displayed for debugging purposes. This only works if debug mode is turned on
public
debugDisplayNextQuerySql() : mixed
delete()
Table-based delete
public
delete(string $table, array<string|int, mixed> $conditions[, mixed $shutdown = false ]) : mixed
Parameters
- $table : string
- $conditions : array<string|int, mixed>
-
OR string vB_dB_Query::CONDITION_ALL
- $shutdown : mixed = false
escape_string()
This function is deprecated and will be removed. Do not use it.
public
escape_string(mixed $string) : mixed
Parameters
- $string : mixed
Tags
executeShutdownQueries()
public
executeShutdownQueries() : mixed
fetchTableStructure()
This gets the structure of a specific table. Used initially for complex queries
public
static fetchTableStructure(mixed $table) : array<string|int, mixed>
@param string standard table definition syntax
Parameters
- $table : mixed
Return values
array<string|int, mixed> —querydef syntax- includes key and structure.
getColumn()
Returns only one table field for all rows for a select query, either a defined query or table-based query.
public
getColumn(mixed $queryId, mixed $column[, array<string|int, mixed> $conditions = [] ][, mixed $orderBy = false ][, mixed $keyField = '' ]) : array<string|int, mixed>
Parameters
- $queryId : mixed
- $column : mixed
- $conditions : array<string|int, mixed> = []
- $orderBy : mixed = false
- $keyField : mixed = ''
Return values
array<string|int, mixed> —The rows
getDbCharsets()
Returns the charset for the database, and optionally also for the given table and column.
public
getDbCharsets([mixed $table = '' ][, mixed $column = '' ]) : array<string|int, mixed>
Parameters
- $table : mixed = ''
- $column : mixed = ''
Return values
array<string|int, mixed> —Array of charsets for database, table, column, and effective charset.
getDBConnection()
Gets the raw database connection object. This is solely implemented as a temporary measure to support legacy code. Do not use it without checking with the dev lead.
public
getDBConnection() : mixed
Tags
getDbType()
public
static getDbType() : mixed
getField()
Retrieves the first column of the first row for a select query (either defined or table-based)
public
getField(string $queryId[, array<string|int, mixed> $conditions = [] ][, mixed $orderBy = false ]) : mixed
Parameters
- $queryId : string
- $conditions : array<string|int, mixed> = []
- $orderBy : mixed = false
getForceSqlMode()
public
getForceSqlMode() : mixed
getNoForceSqlMode()
public
getNoForceSqlMode() : mixed
getQryCount()
This returns the performance data
public
getQryCount() : array<string|int, mixed>
Return values
array<string|int, mixed> —-- int queryCount [string] queries
getRow()
Retrieves the first row for a select query either (defined or table-based)
public
getRow(string $queryId[, array<string|int, mixed> $conditions = [] ][, mixed $orderBy = false ]) : array<string|int, mixed>
Parameters
- $queryId : string
- $conditions : array<string|int, mixed> = []
- $orderBy : mixed = false
Return values
array<string|int, mixed>getRows()
Returns all rows for a select query, either a defined query or table-based query.
public
getRows(mixed $queryId[, array<string|int, mixed> $conditions = [] ][, mixed $orderBy = false ][, mixed $keyField = '' ]) : array<string|int, mixed>
Parameters
- $queryId : mixed
- $conditions : array<string|int, mixed> = []
- $orderBy : mixed = false
- $keyField : mixed = ''
Return values
array<string|int, mixed> —The rows
hide_errors()
Switches database error display OFF
public
hide_errors() : mixed
init()
This sets the db. It will normally be called in the boot process
public
static init(mixed &$dbconfig, mixed &$config) : mixed
Parameters
- $dbconfig : mixed
- $config : mixed
insert()
Table-based insert
public
insert(string $table, array<string|int, mixed> $params[, mixed $shutdown = false ]) : mixed
Parameters
- $table : string
- $params : array<string|int, mixed>
- $shutdown : mixed = false
insertIgnore()
Table-based insert ignore
public
insertIgnore(string $table, array<string|int, mixed> $params[, mixed $shutdown = false ]) : mixed
Parameters
- $table : string
- $params : array<string|int, mixed>
- $shutdown : mixed = false
insertMultiple()
Table-based multiple insert
public
insertMultiple(string $table, array<string|int, mixed> $fields, array<string|int, mixed> $values[, mixed $shutdown = false ]) : mixed
Parameters
- $table : string
- $fields : array<string|int, mixed>
- $values : array<string|int, mixed>
- $shutdown : mixed = false
instance()
returns the singleton instance
public
static instance() : mixed
inTransaction()
Standard transaction handler. Needs to be implemented in the child
public
inTransaction() : bool
Return values
bool —whether a transaction has been started but not committed/rolled back
replace()
Table-based replace query
public
replace(string $table, array<string|int, mixed> $params[, mixed $shutdown = false ]) : mixed
Parameters
- $table : string
- $params : array<string|int, mixed>
- $shutdown : mixed = false
rollbackTransaction()
Standard transaction handler. Needs to be implemented in the child
public
rollbackTransaction() : mixed
select()
Table-based select
public
select(string $table, array<string|int, mixed> $conditions[, mixed $orderBy = false ][, array<string|int, mixed> $columns = [] ]) : vB_dB_Result
Parameters
- $table : string
- $conditions : array<string|int, mixed>
-
OR string vB_dB_Query::CONDITION_ALL
- $orderBy : mixed = false
- $columns : array<string|int, mixed> = []
Return values
vB_dB_Resultshow_errors()
Switches database error display ON
public
show_errors() : mixed
shutdownQuery()
Registers a query to be executed at shutdown time. If shutdown functions are disabled, the query is run immediately.
public
shutdownQuery(mixed $queryid, mixed $params[, mixed $arraykey = -1 ]) : bool
Parameters
- $queryid : mixed
- $params : mixed
- $arraykey : mixed = -1
Return values
boolskipShutdown()
Disable the shutdown queries. Primarily reduces contention for session table.
public
skipShutdown([mixed $noShutdown = true ]) : mixed
Parameters
- $noShutdown : mixed = true
unregisterShutdownQuery()
public
unregisterShutdownQuery(mixed $queryKey) : mixed
Parameters
- $queryKey : mixed
update()
Table-based update
public
update(string $table, array<string|int, mixed> $values, array<string|int, mixed> $conditions[, mixed $shutdown = false ]) : mixed
Parameters
- $table : string
- $values : array<string|int, mixed>
- $conditions : array<string|int, mixed>
-
OR string vB_dB_Query::CONDITION_ALL
- $shutdown : mixed = false