vBulletin v5.7.2

vB_dB_QueryBuilder
in package
Uses vB_Trait_NoSerialize

This class is a base intended to contain the backend specific details for converting assertor conditions to query code. The logic is contained in the base class for the time being to allow additional sql backends to override specific functions as much of it will be applicable. We'll most likely need to heavily refactor this when we add a second backend, but that will be more efficiently done when we know what the requirements of that backend really are.

Note that this class is intended to be cached and reused therefore anything that is specific to a particular query needs to be passed as parameter to methods rather than being stored in the class itself. Only items specific to the db backend should be class members.

This is internal to the assertor interface and should not be called from the Application code directly.

Table of Contents

__construct()  : mixed
Construct the query builder
__serialize()  : array<string|int, mixed>
__sleep()  : array<string|int, mixed>
__unserialize()  : void
__wakeup()  : void
conditionsToFilter()  : mixed
This function generates the query text against a table.
escapeField()  : string
Handle situations were the field name might be a reserved word. Also allow for qualified names.
escapeFields()  : array<string|int, mixed>
Handle situations were the field name might be a reserved word. Also allow for qualified names.
escapeTable()  : mixed
Escapes a table name -- also qualifies it with the table prefix automatically.
makeCountQuery()  : mixed
makeDeleteQuery()  : mixed
makeInsertMultipleQuery()  : mixed
makeInsertQuery()  : mixed
makeReplaceQuery()  : mixed
makeSelectQuery()  : mixed
makeUpdateQuery()  : mixed
matchValues()  : mixed
This matches a series of values against a query string
primaryKeyToFilter()  : mixed
setDebugSQL()  : mixed
valueArrayToFilter()  : mixed
valueArrayToSetLine()  : mixed

Methods

__construct()

Construct the query builder

public __construct( $db, mixed $debug_sql) : mixed
Parameters
$db :

The db backend specific interface object.

$debug_sql : mixed
Return values
mixed

__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>
Return values
void

__wakeup()

public __wakeup() : void
Return values
void

conditionsToFilter()

This function generates the query text against a table.

public conditionsToFilter(mixed $conditions[, mixed $forcetext = array() ]) : mixed
Parameters
$conditions : mixed
$forcetext : mixed = array()
Return values
mixed

escapeField()

Handle situations were the field name might be a reserved word. Also allow for qualified names.

public escapeField(string $field) : string
Parameters
$field : string

-- the field name

Return values
string

escaped version of the field name

escapeFields()

Handle situations were the field name might be a reserved word. Also allow for qualified names.

public escapeFields(array<string|int, mixed> $fields) : array<string|int, mixed>

Handles an array of fieldnames

Parameters
$fields : array<string|int, mixed>

-- the field names

Return values
array<string|int, mixed>

escaped version of the field names

escapeTable()

Escapes a table name -- also qualifies it with the table prefix automatically.

public escapeTable(string $table) : mixed
Parameters
$table : string

-- the name of the table

Return values
mixed

makeCountQuery()

public makeCountQuery(mixed $table, mixed $filter, mixed $structure) : mixed
Parameters
$table : mixed
$filter : mixed
$structure : mixed
Return values
mixed

makeDeleteQuery()

public makeDeleteQuery(mixed $table, mixed $filter[, mixed $params = array() ]) : mixed
Parameters
$table : mixed
$filter : mixed
$params : mixed = array()
Return values
mixed

makeInsertMultipleQuery()

public makeInsertMultipleQuery(mixed $table, mixed $values[, mixed $forcetext = array() ]) : mixed
Parameters
$table : mixed
$values : mixed
$forcetext : mixed = array()
Return values
mixed

makeInsertQuery()

public makeInsertQuery(mixed $table, mixed $ignore, mixed $values[, mixed $forcetext = array() ]) : mixed
Parameters
$table : mixed
$ignore : mixed
$values : mixed
$forcetext : mixed = array()
Return values
mixed

makeReplaceQuery()

public makeReplaceQuery(mixed $table, mixed $values[, mixed $forcetext = array() ]) : mixed
Parameters
$table : mixed
$values : mixed
$forcetext : mixed = array()
Return values
mixed

makeSelectQuery()

public makeSelectQuery(mixed $table, mixed $filter, mixed $sortorder, mixed $structure[, mixed $params = array() ]) : mixed
Parameters
$table : mixed
$filter : mixed
$sortorder : mixed
$structure : mixed
$params : mixed = array()
Return values
mixed

makeUpdateQuery()

public makeUpdateQuery(mixed $table, mixed $filter, mixed $setline[, mixed $params = array() ]) : mixed
Parameters
$table : mixed
$filter : mixed
$setline : mixed
$params : mixed = array()
Return values
mixed

matchValues()

This matches a series of values against a query string

public matchValues(mixed $queryid, mixed $querystring, mixed $values[, mixed $forcetext = array() ]) : mixed
Parameters
$queryid : mixed
$querystring : mixed
$values : mixed
$forcetext : mixed = array()
Return values
mixed

primaryKeyToFilter()

public primaryKeyToFilter(mixed $primarykey, mixed &$values[, mixed $forcetext = array() ]) : mixed
Parameters
$primarykey : mixed
$values : mixed
$forcetext : mixed = array()
Return values
mixed

setDebugSQL()

public setDebugSQL(mixed $debug_sql) : mixed
Parameters
$debug_sql : mixed
Return values
mixed

valueArrayToFilter()

public valueArrayToFilter(mixed $values[, mixed $forcetext = array() ]) : mixed
Parameters
$values : mixed
$forcetext : mixed = array()
Return values
mixed

valueArrayToSetLine()

public valueArrayToSetLine(mixed $values[, mixed $forcetext = array() ]) : mixed
Parameters
$values : mixed
$forcetext : mixed = array()
Return values
mixed

Search results