class SqlBuilder extends Object

Builds SQL query.

SqlBuilder is based on great library NotORM http://www.notorm.com written by Jakub Vrana.

Properties

protected string $tableName
protected IConventions $conventions
protected string $delimitedTable
protected array $select
protected array $where
protected array $conditions
protected array $parameters
protected array $order
protected int $limit
protected int $offset
protected string $group
protected string $having

Methods

__construct($tableName, Context $context)

No description

string
getTableName()

No description

buildInsertQuery()

No description

buildUpdateQuery()

No description

buildDeleteQuery()

No description

string
buildSelectQuery($columns = NULL)

Returns SQL query.

getParameters()

No description

importConditions(SqlBuilder $builder)

No description

addSelect($columns)

No description

getSelect()

No description

addWhere($condition, $parameters = array())

No description

getConditions()

No description

addOrder($columns)

No description

setOrder(array $columns, array $parameters)

No description

getOrder()

No description

setLimit($limit, $offset)

No description

getLimit()

No description

getOffset()

No description

setGroup($columns)

No description

getGroup()

No description

setHaving($having)

No description

getHaving()

No description

buildSelect(array $columns)

No description

parseJoins($joins, $query)

No description

parseJoinsCb($joins, $match)

No description

buildQueryJoins(array $joins)

No description

buildConditions()

No description

buildQueryEnd()

No description

tryDelimite($s)

No description

addWhereComposition(array $columns, array $parameters)

No description

Details

at line 77
__construct($tableName, Context $context)

No description

Parameters

$tableName
Context $context

at line 90
string getTableName()

No description

Return Value

string

at line 96
buildInsertQuery()

No description

at line 102
buildUpdateQuery()

No description

at line 111
buildDeleteQuery()

No description

at line 125
string buildSelectQuery($columns = NULL)

Returns SQL query.

Parameters

$columns

Return Value

string

at line 166
getParameters()

No description

at line 178
importConditions(SqlBuilder $builder)

No description

Parameters

SqlBuilder $builder

at line 189
addSelect($columns)

No description

Parameters

$columns

at line 199
getSelect()

No description

at line 205
addWhere($condition, $parameters = array())

No description

Parameters

$condition
$parameters

at line 324
getConditions()

No description

at line 330
addOrder($columns)

No description

Parameters

$columns

at line 337
setOrder(array $columns, array $parameters)

No description

Parameters

array $columns
array $parameters

at line 344
getOrder()

No description

at line 350
setLimit($limit, $offset)

No description

Parameters

$limit
$offset

at line 357
getLimit()

No description

at line 363
getOffset()

No description

at line 369
setGroup($columns)

No description

Parameters

$columns

at line 376
getGroup()

No description

at line 382
setHaving($having)

No description

Parameters

$having

at line 389
getHaving()

No description

at line 398
protected buildSelect(array $columns)

No description

Parameters

array $columns

at line 404
protected parseJoins($joins, $query)

No description

Parameters

$joins
$query

at line 420
parseJoinsCb($joins, $match)

No description

Parameters

$joins
$match

at line 501
protected buildQueryJoins(array $joins)

No description

Parameters

array $joins

at line 515
protected buildConditions()

No description

at line 521
protected buildQueryEnd()

No description

at line 537
protected tryDelimite($s)

No description

Parameters

$s

at line 546
protected addWhereComposition(array $columns, array $parameters)

No description

Parameters

array $columns
array $parameters