SqlBuilder
class SqlBuilder
Builds SQL query.
SqlBuilder is based on great library NotORM http://www.notorm.com written by Jakub Vrana.
Properties
protected | $tableName | ||
protected | $conventions | ||
protected | $delimitedTable | ||
protected | $select | ||
protected | $where | ||
protected | $joinCondition | ||
protected | $conditions | ||
protected | $parameters | ||
protected | $order | ||
protected | $limit | ||
protected | $offset | ||
protected | $group | ||
protected | $having | ||
protected | $reservedTableNames | ||
protected | $aliases | ||
protected | $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 55
__construct(string $tableName, Explorer $explorer)
No description
at line 67
string
getTableName()
No description
at line 73
string
buildInsertQuery()
No description
at line 79
string
buildUpdateQuery()
No description
at line 95
string
buildDeleteQuery()
No description
at line 109
string
getSelectQueryHash(array|null $columns = null)
Returns select query hash for caching.
at line 143
string
buildSelectQuery(array|null $columns = null)
Returns SQL query.
at line 192
array
getParameters()
No description
at line 209
void
importConditions(SqlBuilder $builder)
No description
at line 221
bool
importGroupConditions(SqlBuilder $builder)
No description
at line 238
void
addSelect(string $columns, ...$params)
No description
at line 245
array
getSelect()
No description
at line 251
void
resetSelect()
No description
at line 258
bool
addWhere(string|array $condition, ...$params)
No description
at line 264
bool
addJoinCondition(string $tableChain, string|array $condition, ...$params)
No description
at line 275
protected bool
addCondition(string|array $condition, array $params, array $conditions, array $conditionsParameters)
No description
at line 405
array
getConditions()
No description
at line 414
void
addAlias(string $chain, string $alias)
Adds alias.
at line 425
protected void
checkUniqueTableName(string $tableName, string $chain)
No description
at line 443
void
addOrder(string|array $columns, ...$params)
No description
at line 450
void
setOrder(array $columns, array $parameters)
No description
at line 457
array
getOrder()
No description
at line 463
void
setLimit(int|null $limit, int|null $offset)
No description
at line 470
int|null
getLimit()
No description
at line 476
int|null
getOffset()
No description
at line 482
void
setGroup(string|array $columns, ...$params)
No description
at line 489
string
getGroup()
No description
at line 495
void
setHaving(string $having, ...$params)
No description
at line 502
string
getHaving()
No description
at line 511
protected string
buildSelect(array $columns)
No description
at line 517
protected array
parseJoinConditions(array $joins, array $joinConditions)
No description
at line 553
protected void
getSortedJoins(string $table, array $leftJoinDependency, array $tableJoins, array $finalJoins)
No description
at line 606
protected void
parseJoins(array $joins, string $query)
No description
at line 622
string
parseJoinsCb(array $joins, array $match)
No description
at line 740
protected string
buildQueryJoins(array $joins, array $leftJoinConditions = [])
No description
at line 754
protected array
buildJoinConditions()
No description
at line 765
protected string
buildConditions()
No description
at line 773
protected string
buildQueryEnd()
No description
at line 792
protected string
tryDelimite(string $s)
No description
at line 804
protected bool
addConditionComposition(array $columns, array $parameters, array $conditions, array $conditionsParameters)
No description