SqlBuilder
class SqlBuilder
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 | $joinCondition | ||
protected array | $conditions | ||
protected array | $parameters | ||
protected array | $order | ||
protected int | $limit | ||
protected int | $offset | ||
protected string | $group | ||
protected string | $having | ||
protected array | $reservedTableNames | ||
protected array | $aliases | ||
protected string | $currentAlias |
Methods
No description
No description
No description
No description
Returns select query hash for caching.
Returns SQL query.
No description
No description
No description
No description
No description
No description
No description
No description
Adds alias.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Details
at line 94
__construct($tableName, Context $context)
No description
at line 109
string
getTableName()
No description
at line 118
buildInsertQuery()
No description
at line 127
buildUpdateQuery()
No description
at line 146
buildDeleteQuery()
No description
at line 161
string
getSelectQueryHash(array $columns = null)
Returns select query hash for caching.
at line 195
string
buildSelectQuery(array $columns = null)
Returns SQL query.
at line 246
array
getParameters()
No description
at line 262
importConditions(SqlBuilder $builder)
No description
at line 274
bool
importGroupConditions(SqlBuilder $builder)
No description
at line 290
addSelect($columns, ...$params)
No description
at line 303
array
getSelect()
No description
at line 309
resetSelect()
No description
at line 319
bool
addWhere($condition, ...$params)
No description
at line 328
array
addJoinCondition($tableChain, $condition, ...$params)
No description
at line 341
protected bool
addCondition($condition, array $params, array $conditions, array $conditionsParameters)
No description
at line 460
array
getConditions()
No description
at line 472
void
addAlias($chain, $alias)
Adds alias.
at line 487
protected void
checkUniqueTableName($tableName, $chain)
No description
at line 502
addOrder($columns, ...$params)
No description
at line 509
setOrder(array $columns, array $parameters)
No description
at line 519
array
getOrder()
No description
at line 530
void
setLimit($limit, $offset)
No description
at line 540
int|null
getLimit()
No description
at line 549
int|null
getOffset()
No description
at line 555
setGroup($columns, ...$params)
No description
at line 565
string
getGroup()
No description
at line 571
setHaving($having, ...$params)
No description
at line 581
string
getHaving()
No description
at line 593
protected string
buildSelect(array $columns)
No description
at line 602
protected array
parseJoinConditions($joins, $joinConditions)
No description
at line 635
protected
getSortedJoins($table, $leftJoinDependency, $tableJoins, $finalJoins)
No description
at line 669
protected
parseJoins($joins, $query)
No description
at line 691
string
parseJoinsCb($joins, $match)
No description
at line 797
protected string
buildQueryJoins(array $joins, array $leftJoinConditions = [])
No description
at line 813
protected array
buildJoinConditions()
No description
at line 826
protected string
buildConditions()
No description
at line 835
protected string
buildQueryEnd()
No description
at line 854
protected string
tryDelimite($s)
No description
at line 865
protected bool
addConditionComposition(array $columns, array $parameters, array $conditions, array $conditionsParameters)
No description