# \QueryAbstractQueryBuilder

Abstract Class for internal implementation methods of the Query Builder

## Summary

Methods
Properties
Constants
No public methods found
$connName
$queries
$db
$parser
$util
$sql
KEY
VALUE
BOTH
_mixedSet()
_select()
_getCompile()
_like()
_having()
_where()
_whereString()
_whereIn()
_run()
_appendMap()
_appendQuery()
_compileType()
_compile()
$selectString
$fromString
$setString
$orderString
$groupString
$setArrayKeys
$orderArray
$groupArray
$values
$whereValues
$limit
$offset
$queryMap
$havingMap
$explain
N/A
No private methods found
No private properties found
N/A
abstract

File
  Query/AbstractQueryBuilder.php
Package
  Default
Class hierarchy
  \Query\AbstractQueryBuilder

## Tags

None found

## Constants

### KEY

    KEY

#

## Tags

None found

### VALUE

    VALUE

#

## Tags

None found

### BOTH

    BOTH

#

## Tags

None found

## Properties

### $connName

    $connName : string

Convenience property for connection management

#### Type

string

#

## Tags

None found

### $queries

    $queries : array

List of queries executed

#### Type

array

#

## Tags

None found

### $db

    $db : \Query\Drivers\DriverInterface

The current database driver

#### Type

\Query\Drivers\DriverInterface

#

## Tags

None found

### $parser

    $parser : \Query\QueryParser

Query parser class instance

#### Type

\Query\QueryParser

#

## Tags

None found

### $util

    $util : \Query\Drivers\AbstractUtil

Alias to driver util class

#### Type

\Query\Drivers\AbstractUtil

#

## Tags

None found

### $sql

    $sql : \Query\Drivers\SQLInterface

Alias to driver sql class

#### Type

\Query\Drivers\SQLInterface

#

## Tags

None found

### $selectString

    $selectString : string

Compiled 'select' clause

#### Type

string

#

## Tags

None found

### $fromString

    $fromString : string

Compiled 'from' clause

#### Type

string

#

## Tags

None found

### $setString

    $setString : string

Compiled arguments for insert / update

#### Type

string

#

## Tags

None found

### $orderString

    $orderString : string

Order by clause

#### Type

string

#

## Tags

None found

### $groupString

    $groupString : string

Group by clause

#### Type

string

#

## Tags

None found

### $setArrayKeys

    $setArrayKeys : array

Keys for insert/update statement

#### Type

array

#

## Tags

None found

### $orderArray

    $orderArray : array

Key/val pairs for order by clause

#### Type

array

#

## Tags

None found

### $groupArray

    $groupArray : array

Key/val pairs for group by clause

#### Type

array

#

## Tags

None found

### $values

    $values : array

Values to apply to prepared statements

#### Type

array

#

## Tags

None found

### $whereValues

    $whereValues : array

Values to apply to where clauses in prepared statements

#### Type

array

#

## Tags

None found

### $limit

    $limit : string

Value for limit string

#### Type

string

#

## Tags

None found

### $offset

    $offset : integer

Value for offset in limit string

#### Type

integer

#

## Tags

None found

### $queryMap

    $queryMap : array

Query component order mapping for complex select queries

Format: array( 'type' => 'where', 'conjunction' => ' AND ', 'string' => 'k=?' )

#### Type

array

#

## Tags

None found

### $havingMap

    $havingMap : array

Map for having clause

#### Type

array

#

## Tags

None found

### $explain

    $explain : boolean

Whether to do only an explain on the query

#### Type

boolean

#

## Tags

None found

## Methods

### _mixedSet()

    _mixedSet(array  $var, mixed  $key, mixed  $val = NULL, integer  $valType = self::BOTH) : array

Set values in the class, with either an array or key value pair

#### Parameters

array | $var |
mixed | $key |
mixed | $val |
integer | $valType |

#### Returns

array

#

## Tags

None found

### _select()

    _select(string  $field, string|boolean  $as = FALSE) : string

Method to simplify select_ methods

#### Parameters

string | $field |
string|boolean | $as |

#### Returns

string

#

## Tags

None found

### _getCompile()

    _getCompile(string  $type, string  $table, boolean  $reset) : string

Helper function for returning sql strings

#### Parameters

string | $type |
string | $table |
boolean | $reset |

#### Returns

string

#

## Tags

None found

### _like()

    _like(string  $field, mixed  $val, string  $pos, string  $like = 'LIKE', string  $conj = 'AND') : \Query\QueryBuilderInterface

Simplify 'like' methods

#### Parameters

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

#### Returns

\Query\QueryBuilderInterface

#

## Tags

None found

### _having()

    _having(mixed  $key, mixed  $val = array(), string  $conj = 'AND') : \Query\QueryBuilderInterface

Simplify building having clauses

#### Parameters

mixed | $key |
mixed | $val |
string | $conj |

#### Returns

\Query\QueryBuilderInterface

#

## Tags

None found

### _where()

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

Do all the redundant stuff for where/having type methods

#### Parameters

mixed | $key |
mixed | $val |

#### Returns

array

#

## Tags

None found

### _whereString()

    _whereString(mixed  $key, mixed  $val = array(), string  $defaultConj = 'AND') : \Query\QueryBuilderInterface

Simplify generating where string

#### Parameters

mixed | $key |
mixed | $val |
string | $defaultConj |

#### Returns

\Query\QueryBuilderInterface

#

## Tags

None found

### _whereIn()

    _whereIn(mixed  $key, mixed  $val = array(), string  $in = 'IN', string  $conj = 'AND') : \Query\QueryBuilderInterface

Simplify where_in methods

#### Parameters

mixed | $key |
mixed | $val |

string

$in

- The (not) in fragment

string

$conj

- The where in conjunction

#### Returns

\Query\QueryBuilderInterface

#

## Tags

None found

### _run()

    _run(string  $type, string  $table, string  $sql = NULL, array|null  $vals = NULL, boolean  $reset = TRUE) : \PDOStatement

Executes the compiled query

#### Parameters

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

#### Returns

\PDOStatement

#

## Tags

None found

### _appendMap()

    _appendMap(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 |

#

## Tags

None found

### _appendQuery()

    _appendQuery(array  $vals, string  $sql, integer  $totalTime) : void

Convert the prepared statement into readable sql

#### Parameters

array | $vals |
string | $sql |
integer | $totalTime |

#

## Tags

None found

### _compileType()

    _compileType(string  $type = '', string  $table = '') : string

Sub-method for generating sql strings

#### Parameters

string | $type |
string | $table |

#### Returns

string

#

## Tags

None found

### _compile()

    _compile(string  $type = '', string  $table = '') : string

String together the sql statements for sending to the db

#### Parameters

string | $type |
string | $table |

#### Returns

string

#

## Tags

None found

### AbstractQueryBuilder.php