KEY
KEY
Convenience class for creating sql queries
$db : \Query\Drivers\DriverInterface
The current database driver
$parser : \Query\QueryParser
Query parser class instance
$util : \Query\Drivers\AbstractUtil
Alias to driver util class
$sql : \Query\Drivers\SQLInterface
Alias to driver sql class
__construct(\Query\Drivers\DriverInterface $db, \Query\QueryParser $parser)
Constructor
\Query\Drivers\DriverInterface | $db | |
\Query\QueryParser | $parser |
select(string $fields) : \Query\QueryBuilderInterface
Specifies rows to select in a query
string | $fields |
selectMax(string $field, string|boolean $as = FALSE) : \Query\QueryBuilderInterface
Selects the maximum value of a field from a query
string | $field | |
string|boolean | $as |
selectMin(string $field, string|boolean $as = FALSE) : \Query\QueryBuilderInterface
Selects the minimum value of a field from a query
string | $field | |
string|boolean | $as |
selectAvg(string $field, string|boolean $as = FALSE) : \Query\QueryBuilderInterface
Selects the average value of a field from a query
string | $field | |
string|boolean | $as |
selectSum(string $field, string|boolean $as = FALSE) : \Query\QueryBuilderInterface
Selects the sum of a field from a query
string | $field | |
string|boolean | $as |
distinct() : \Query\QueryBuilderInterface
Adds the 'distinct' keyword to a query
explain() : \Query\QueryBuilderInterface
Tell the database to give you the query plan instead of result set
from(string $tblname) : \Query\QueryBuilderInterface
Specify the database table to select from
string | $tblname |
like(string $field, mixed $val, string $pos = 'both') : \Query\QueryBuilderInterface
Creates a Like clause in the sql statement
string | $field | |
mixed | $val | |
string | $pos |
orLike(string $field, mixed $val, string $pos = 'both') : \Query\QueryBuilderInterface
Generates an OR Like clause
string | $field | |
mixed | $val | |
string | $pos |
notLike(string $field, mixed $val, string $pos = 'both') : \Query\QueryBuilderInterface
Generates a NOT LIKE clause
string | $field | |
mixed | $val | |
string | $pos |
orNotLike(string $field, mixed $val, string $pos = 'both') : \Query\QueryBuilderInterface
Generates a OR NOT LIKE clause
string | $field | |
mixed | $val | |
string | $pos |
having(mixed $key, mixed $val = array()) : \Query\QueryBuilderInterface
Generates a 'Having' clause
mixed | $key | |
mixed | $val |
orHaving(mixed $key, mixed $val = array()) : \Query\QueryBuilderInterface
Generates a 'Having' clause prefixed with 'OR'
mixed | $key | |
mixed | $val |
where(mixed $key, mixed $val = array(), mixed $escape = NULL) : \Query\QueryBuilderInterface
Specify condition(s) in the where clause of a query Note: this function works with key / value, or a passed array with key / value pairs
mixed | $key | |
mixed | $val | |
mixed | $escape |
orWhere(string $key, mixed $val = array()) : \Query\QueryBuilderInterface
Where clause prefixed with "OR"
string | $key | |
mixed | $val |
whereIn(mixed $field, mixed $val = array()) : \Query\QueryBuilderInterface
Where clause with 'IN' statement
mixed | $field | |
mixed | $val |
orWhereIn(string $field, mixed $val = array()) : \Query\QueryBuilderInterface
Where in statement prefixed with "or"
string | $field | |
mixed | $val |
whereNotIn(string $field, mixed $val = array()) : \Query\QueryBuilderInterface
WHERE NOT IN (FOO) clause
string | $field | |
mixed | $val |
orWhereNotIn(string $field, mixed $val = array()) : \Query\QueryBuilderInterface
OR WHERE NOT IN (FOO) clause
string | $field | |
mixed | $val |
set(mixed $key, mixed $val = NULL) : \Query\QueryBuilderInterface
Sets values for inserts / updates / deletes
mixed | $key | |
mixed | $val |
join(string $table, string $condition, string $type = '') : \Query\QueryBuilderInterface
Creates a join phrase in a compiled query
string | $table | |
string | $condition | |
string | $type |
groupBy(mixed $field) : \Query\QueryBuilderInterface
Group the results by the selected field(s)
mixed | $field |
orderBy(string $field, string $type = "") : \Query\QueryBuilderInterface
Order the results by the selected field(s)
string | $field | |
string | $type |
limit(integer $limit, integer|boolean $offset = FALSE) : \Query\QueryBuilderInterface
Set a limit on the current sql statement
integer | $limit | |
integer|boolean | $offset |
groupStart() : \Query\QueryBuilderInterface
Adds a paren to the current query for query grouping
notGroupStart() : \Query\QueryBuilderInterface
Adds a paren to the current query for query grouping, prefixed with 'NOT'
orGroupStart() : \Query\QueryBuilderInterface
Adds a paren to the current query for query grouping, prefixed with 'OR'
orNotGroupStart() : \Query\QueryBuilderInterface
Adds a paren to the current query for query grouping, prefixed with 'OR NOT'
groupEnd() : \Query\QueryBuilderInterface
Ends a query group
_like(string $field, mixed $val, string $pos, string $like = 'LIKE', string $conj = 'AND') : \Query\QueryBuilderInterface
Simplify 'like' methods
string | $field | |
mixed | $val | |
string | $pos | |
string | $like | |
string | $conj |
_having(mixed $key, mixed $val = array(), string $conj = 'AND') : \Query\QueryBuilderInterface
Simplify building having clauses
mixed | $key | |
mixed | $val | |
string | $conj |
_whereString(mixed $key, mixed $val = array(), string $defaultConj = 'AND') : \Query\QueryBuilderInterface
Simplify generating where string
mixed | $key | |
mixed | $val | |
string | $defaultConj |
_whereIn(mixed $key, mixed $val = array(), string $in = 'IN', string $conj = 'AND') : \Query\QueryBuilderInterface
Simplify where_in methods
mixed | $key | |
mixed | $val | |
string | $in |
|
string | $conj |
|