Properties

$conn_name

$conn_name : string

Convenience property for connection management

Type

string

$queries

$queries : array

List of queries executed

Type

array

$select_string

$select_string : string

Compiled 'select' clause

Type

string

$from_string

$from_string : string

Compiled 'from' clause

Type

string

$set_string

$set_string : string

Compiled arguments for insert / update

Type

string

$order_string

$order_string : string

Order by clause

Type

string

$group_string

$group_string : string

Group by clause

Type

string

$set_array_keys

$set_array_keys : array

Keys for insert/update statement

Type

array

$order_array

$order_array : array

Key/val pairs for order by clause

Type

array

$group_array

$group_array : array

Key/val pairs for group by clause

Type

array

$values

$values : array

Values to apply to prepared statements

Type

array

$where_values

$where_values : array

Values to apply to where clauses in prepared statements

Type

array

$limit

$limit : string

Value for limit string

Type

string

$offset

$offset : int

Value for offset in limit string

Type

int

$query_map

$query_map : array

Query component order mapping for complex select queries

Format: array(

'type' => 'where',
'conjunction' => ' AND ',
'string' => 'k=?'

)

Type

array

$having_map

$having_map : array

Map for having clause

Type

array

$explain

$explain : bool

Whether to do only an explain on the query

Type

bool

Methods

__call()

__call(string $name, array $params) : mixed

Calls a function further down the inheritence chain

Parameters

string $name
array $params

Throws

\BadMethodCallException

Returns

mixed

_select()

_select(string $field, string|bool $as) : string

Method to simplify select_ methods

Parameters

string $field
string|bool $as

Returns

string

_get_compile()

_get_compile(string $type, string $table, bool $reset) : string

Helper function for returning sql strings

Parameters

string $type
string $table
bool $reset

Returns

string

_like()

_like(string $field, mixed $val, string $pos, string $like, string $conj) : \Query\Query_Builder

Simplify 'like' methods

Parameters

string $field
mixed $val
string $pos
string $like
string $conj

Returns

\Query\Query_Builder

_having()

_having(mixed $key, mixed $val, string $conj) : \Query\Query_Builder

Simplify building having clauses

Parameters

mixed $key
mixed $val
string $conj

Returns

\Query\Query_Builder

_where()

_where(mixed $key, mixed $val) : array

Do all the repeditive stuff for where/having type methods

Parameters

mixed $key
mixed $val

Returns

array

_where_string()

_where_string(mixed $key, mixed $val, string $conj) : \Query\Query_Builder

Simplify generating where string

Parameters

mixed $key
mixed $val
string $conj

Returns

\Query\Query_Builder

_where_in()

_where_in(mixed $key, mixed $val, string $in, string $conj) : \Query\Query_Builder

Simplify where_in methods

Parameters

mixed $key
mixed $val
string $in
  • The (not) in fragment
string $conj
  • The where in conjunction

Returns

\Query\Query_Builder

_run()

_run(string $type, string $table, string $sql, array|null $vals) : \PDOStatement

Executes the compiled query

Parameters

string $type
string $table
string $sql
array|null $vals

Returns

\PDOStatement

_append_map()

_append_map(string $conjunction, string $string, string $type) : void

Add an additional set of mapping pairs to a internal map

Parameters

string $conjunction
string $string
string $type

_append_query()

_append_query(array $vals, string $sql, string $total_time) : void

Convert the prepared statement into readable sql

Parameters

array $vals
string $sql
string $total_time

_compile_type()

_compile_type(string $type, string $table) : string

Sub-method for generating sql strings

Parameters

string $type
string $table

Returns

string

_compile()

_compile(string $type, string $table) : \Query\$string

String together the sql statements for sending to the db

Parameters

string $type
string $table

Returns

\Query\$string