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 Conventions | $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 96
__construct(string $tableName, Explorer $explorer)
No description
at line 108
string
getTableName()
No description
at line 114
string
buildInsertQuery()
No description
at line 120
string
buildUpdateQuery()
No description
at line 136
string
buildDeleteQuery()
No description
at line 150
string
getSelectQueryHash(array $columns = null)
Returns select query hash for caching.
at line 183
string
buildSelectQuery(array $columns = null)
Returns SQL query.
at line 231
array
getParameters()
No description
at line 247
void
importConditions(SqlBuilder $builder)
No description
at line 259
bool
importGroupConditions(SqlBuilder $builder)
No description
at line 275
void
addSelect($columns, ...$params)
No description
at line 285
array
getSelect()
No description
at line 291
void
resetSelect()
No description
at line 298
bool
addWhere($condition, ...$params)
No description
at line 304
bool
addJoinCondition(string $tableChain, $condition, ...$params)
No description
at line 314
protected bool
addCondition($condition, array $params, array $conditions, array $conditionsParameters)
No description
at line 434
array
getConditions()
No description
at line 443
void
addAlias(string $chain, string $alias)
Adds alias.
at line 453
protected void
checkUniqueTableName(string $tableName, string $chain)
No description
at line 468
void
addOrder($columns, ...$params)
No description
at line 475
void
setOrder(array $columns, array $parameters)
No description
at line 482
array
getOrder()
No description
at line 488
void
setLimit(int|null $limit, int|null $offset)
No description
at line 495
int|null
getLimit()
No description
at line 501
int|null
getOffset()
No description
at line 507
void
setGroup($columns, ...$params)
No description
at line 514
string
getGroup()
No description
at line 520
void
setHaving($having, ...$params)
No description
at line 527
string
getHaving()
No description
at line 536
protected string
buildSelect(array $columns)
No description
at line 542
protected array
parseJoinConditions($joins, $joinConditions)
No description
at line 575
protected void
getSortedJoins(string $table, $leftJoinDependency, $tableJoins, $finalJoins)
No description
at line 614
protected void
parseJoins($joins, $query)
No description
at line 630
string
parseJoinsCb($joins, $match)
No description
at line 740
protected string
buildQueryJoins(array $joins, array $leftJoinConditions = [])
No description
at line 753
protected array
buildJoinConditions()
No description
at line 763
protected string
buildConditions()
No description
at line 771
protected string
buildQueryEnd()
No description
at line 787
protected string
tryDelimite(string $s)
No description
at line 797
protected bool
addConditionComposition(array $columns, array $parameters, array $conditions, array $conditionsParameters)
No description
Traits
Strict class for better experience.