abstract class vB_dB_Assertor

Traits

Properties

static protected $tableData
static protected $instance
static protected $db The database connection *
static protected $dbSlave
static protected $userinfo The user info **
static protected $dbtype database type *
protected $queryCount
protected $queries
protected $debug
protected $debugLog Do we need to log queries? *
protected $noShutdown
protected array $shutdownqueries Array of queries to be executed when the script shuts down Each item contains the paramaters to call assertQuery
protected bool $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
protected array $dbconfig Reference to the sensitive database configuration array from class vB. Contains information required to connect to the database.

Methods

__sleep()

No description

__wakeup()

No description

__construct($dbconfig, $config)

No description

static 
init($dbconfig, $config)

This sets the db. It will normally be called in the boot process

static 
instance()

returns the singleton instance

static 
getDbType()

No description

getDBConnection() deprecated

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.

setLogQueries($debugLog)

No description

skipShutdown($noShutdown = true)

Disable the shutdown queries. Primarily reduces contention for session table.

mixed
assertQuery(string $queryid, array $params = array(), string $orderby = false)

Core function- validates, composes, and executes a query. See above for more

escape_string($string) deprecated

This function is deprecated and will be removed. Do not use it.

affected_rows()

No description

show_errors()

Switches database error display ON

hide_errors()

Switches database error display OFF

boolean
shutdownQuery($queryid, $params, $arraykey = -1)

Registers a query to be executed at shutdown time. If shutdown functions are disabled, the query is run immediately.

unregisterShutdownQuery($queryKey)

No description

executeShutdownQueries()

No description

static mixed
fetchTableStructure($table)

This gets the structure of a specific table. Used initially for complex queries

insert(string $table, array $params, mixed $shutdown = FALSE)

Table-based insert

insertIgnore(string $table, array $params, mixed $shutdown = FALSE)

Table-based insert ignore

replace(string $table, array $params, mixed $shutdown = FALSE)

Table-based replace query

insertMultiple(string $table, array $fields, array $values, mixed $shutdown = FALSE)

Table-based multiple insert

update(string $table, array $values, array $conditions, mixed $shutdown = FALSE)

Table-based update

delete(string $table, array $conditions, mixed $shutdown = FALSE)

Table-based delete

select(string $table, array $conditions, mixed $orderBy = false, array $columns = array())

Table-based select

mixed
getField(string $queryId, array $conditions = array(), mixed $orderBy = false)

Retrieves the first column of the first row for a select query (either defined or table-based)

array
getRow(string $queryId, array $conditions = array(), mixed $orderBy = false)

Retrieves the first row for a select query either (defined or table-based)

array
getRows(string $queryId, array $conditions = array(), mixed $orderBy = false, string $keyField = '')

Returns all rows for a select query, either a defined query or table-based query.

array
getColumn(string $queryId, string $column, array $conditions = array(), mixed $orderBy = false, string $keyField = '')

Returns only one table field for all rows for a select query, either a defined query or table-based query.

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

array
getQryCount()

This returns the performance data

beginTransaction()

Standard transaction handler. Needs to be implemented in the child

rollbackTransaction()

Standard transaction handler. Needs to be implemented in the child

commitTransaction()

Standard transaction handler. Needs to be implemented in the child

bool
inTransaction()

Standard transaction handler. Needs to be implemented in the child

getNoForceSqlMode()

No description

getForceSqlMode()

No description

Details

in vB_Trait_NoSerialize at line 15
__sleep()

in vB_Trait_NoSerialize at line 20
__wakeup()

at line 116
protected __construct($dbconfig, $config)

Parameters

$dbconfig
$config

at line 129
static init($dbconfig, $config)

This sets the db. It will normally be called in the boot process

Parameters

$dbconfig
$config

at line 161
static instance()

returns the singleton instance

at line 171
static getDbType()

at line 184
getDBConnection() deprecated

deprecated .

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.

at line 189
setLogQueries($debugLog)

Parameters

$debugLog

at line 197
skipShutdown($noShutdown = true)

Disable the shutdown queries. Primarily reduces contention for session table.

Parameters

$noShutdown

at line 211
mixed assertQuery(string $queryid, array $params = array(), string $orderby = false)

Core function- validates, composes, and executes a query. See above for more

Parameters

string $queryid
array $params
string $orderby

Return Value

mixed boolean, integer, or results object

at line 308
escape_string($string) deprecated

deprecated

This function is deprecated and will be removed. Do not use it.

Parameters

$string

at line 313
affected_rows()

at line 321
show_errors()

Switches database error display ON

at line 329
hide_errors()

Switches database error display OFF

at line 344
boolean shutdownQuery($queryid, $params, $arraykey = -1)

Registers a query to be executed at shutdown time. If shutdown functions are disabled, the query is run immediately.

Parameters

$queryid
$params
$arraykey

Return Value

boolean

at line 363
unregisterShutdownQuery($queryKey)

Parameters

$queryKey

at line 368
executeShutdownQueries()

at line 393
static mixed fetchTableStructure($table)

This gets the structure of a specific table. Used initially for complex queries

@param string standard table definition syntax

Parameters

$table

Return Value

mixed querydef syntax- includes key and structure.

at line 443
insert(string $table, array $params, mixed $shutdown = FALSE)

Table-based insert

Parameters

string $table
array $params
mixed $shutdown

at line 463
insertIgnore(string $table, array $params, mixed $shutdown = FALSE)

Table-based insert ignore

Parameters

string $table
array $params
mixed $shutdown

at line 483
replace(string $table, array $params, mixed $shutdown = FALSE)

Table-based replace query

Parameters

string $table
array $params
mixed $shutdown

at line 504
insertMultiple(string $table, array $fields, array $values, mixed $shutdown = FALSE)

Table-based multiple insert

Parameters

string $table
array $fields
array $values
mixed $shutdown

at line 527
update(string $table, array $values, array $conditions, mixed $shutdown = FALSE)

Table-based update

Parameters

string $table
array $values
array $conditions OR string vB_dB_Query::CONDITION_ALL
mixed $shutdown

at line 548
delete(string $table, array $conditions, mixed $shutdown = FALSE)

Table-based delete

Parameters

string $table
array $conditions OR string vB_dB_Query::CONDITION_ALL
mixed $shutdown

at line 571
vB_dB_Result select(string $table, array $conditions, mixed $orderBy = false, array $columns = array())

Table-based select

Parameters

string $table
array $conditions OR string vB_dB_Query::CONDITION_ALL
mixed $orderBy
array $columns

Return Value

vB_dB_Result

at line 596
mixed getField(string $queryId, array $conditions = array(), mixed $orderBy = false)

Retrieves the first column of the first row for a select query (either defined or table-based)

Parameters

string $queryId
array $conditions
mixed $orderBy

Return Value

mixed

at line 618
array getRow(string $queryId, array $conditions = array(), mixed $orderBy = false)

Retrieves the first row for a select query either (defined or table-based)

Parameters

string $queryId
array $conditions
mixed $orderBy

Return Value

array

at line 647
array getRows(string $queryId, array $conditions = array(), mixed $orderBy = false, string $keyField = '')

Returns all rows for a select query, either a defined query or table-based query.

Parameters

string $queryId Query ID for a defined query, or table name for a table-based query
array $conditions Conditions for the where clause
mixed $orderBy Order by (optional)
string $keyField If specified, the returned rows will be keyed using the value of this field (optional)

Return Value

array The rows

at line 681
array getColumn(string $queryId, string $column, array $conditions = array(), mixed $orderBy = false, string $keyField = '')

Returns only one table field for all rows for a select query, either a defined query or table-based query.

Parameters

string $queryId Query ID for a defined query, or table name for a table-based query
string $column The table field name to return
array $conditions Conditions for the where clause
mixed $orderBy Order by (optional)
string $keyField If specified, the returned rows will be keyed using the value of this field (optional)

Return Value

array The rows

at line 717
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

at line 729
array getQryCount()

This returns the performance data

Return Value

array -- int queryCount array(string) queries

at line 740
beginTransaction()

Standard transaction handler. Needs to be implemented in the child

at line 749
rollbackTransaction()

Standard transaction handler. Needs to be implemented in the child

at line 757
commitTransaction()

Standard transaction handler. Needs to be implemented in the child

at line 768
bool inTransaction()

Standard transaction handler. Needs to be implemented in the child

Return Value

bool whether a transaction has been started but not committed/rolled back

at line 775
getNoForceSqlMode()

at line 784
getForceSqlMode()