BaseBuilder.php
system/Database/BaseBuilder.php
1 class
134 methods
class BaseBuilder
Class BaseBuilder Provides the core Query Builder methods. Database-specific Builders might need to override certain methods to make them work.
__construct
($tableName, ConnectionInterface $db, ?array $options = null)
db
()
testMode
(bool $mode = true)
getTable
()
getBinds
()
ignore
(bool $ignore = true)
select
($select = '*', ?bool $escape = null)
selectMax
(string $select = '', string $alias = '')
selectMin
(string $select = '', string $alias = '')
selectAvg
(string $select = '', string $alias = '')
selectSum
(string $select = '', string $alias = '')
selectCount
(string $select = '', string $alias = '')
selectSubquery
(BaseBuilder $subquery, string $as)
maxMinAvgSum
(string $select = '', string $alias = '', string $type = 'MAX')
createAliasFromTable
(string $item)
distinct
(bool $val = true)
from
($from, bool $overwrite = false)
fromSubquery
(BaseBuilder $from, string $alias)
join
(string $table, $cond, string $type = '', ?bool $escape = null)
where
($key, $value = null, ?bool $escape = null)
orWhere
($key, $value = null, ?bool $escape = null)
whereHaving
(string $qbKey, $key, $value = null, string $type = 'AND ', ?bool $escape = null)
whereIn
(?string $key = null, $values = null, ?bool $escape = null)
orWhereIn
(?string $key = null, $values = null, ?bool $escape = null)
whereNotIn
(?string $key = null, $values = null, ?bool $escape = null)
orWhereNotIn
(?string $key = null, $values = null, ?bool $escape = null)
havingIn
(?string $key = null, $values = null, ?bool $escape = null)
orHavingIn
(?string $key = null, $values = null, ?bool $escape = null)
havingNotIn
(?string $key = null, $values = null, ?bool $escape = null)
orHavingNotIn
(?string $key = null, $values = null, ?bool $escape = null)
_whereIn
(?string $key = null, $values = null, bool $not = false, string $type = 'AND ', ?bool $escape = null, string $clause = 'QBWhere')
like
($field, string $match = '', string $side = 'both', ?bool $escape = null, bool $insensitiveSearch = false)
notLike
($field, string $match = '', string $side = 'both', ?bool $escape = null, bool $insensitiveSearch = false)
orLike
($field, string $match = '', string $side = 'both', ?bool $escape = null, bool $insensitiveSearch = false)
orNotLike
($field, string $match = '', string $side = 'both', ?bool $escape = null, bool $insensitiveSearch = false)
havingLike
($field, string $match = '', string $side = 'both', ?bool $escape = null, bool $insensitiveSearch = false)
notHavingLike
($field, string $match = '', string $side = 'both', ?bool $escape = null, bool $insensitiveSearch = false)
orHavingLike
($field, string $match = '', string $side = 'both', ?bool $escape = null, bool $insensitiveSearch = false)
orNotHavingLike
($field, string $match = '', string $side = 'both', ?bool $escape = null, bool $insensitiveSearch = false)
_like
($field, string $match = '', string $type = 'AND ', string $side = 'both', string $not = '', ?bool $escape = null, bool $insensitiveSearch = false, string $clause = 'QBWhere')
_like_statement
(?string $prefix, string $column, ?string $not, string $bind, bool $insensitiveSearch = false)
union
($union)
unionAll
($union)
addUnionStatement
($union, bool $all = false)
groupStart
()
orGroupStart
()
notGroupStart
()
orNotGroupStart
()
groupEnd
()
havingGroupStart
()
orHavingGroupStart
()
notHavingGroupStart
()
orNotHavingGroupStart
()
havingGroupEnd
()
groupStartPrepare
(string $not = '', string $type = 'AND ', string $clause = 'QBWhere')
groupEndPrepare
(string $clause = 'QBWhere')
groupGetType
(string $type)
groupBy
($by, ?bool $escape = null)
having
($key, $value = null, ?bool $escape = null)
orHaving
($key, $value = null, ?bool $escape = null)
orderBy
(string $orderBy, string $direction = '', ?bool $escape = null)
limit
(?int $value = null, ?int $offset = 0)
offset
(int $offset)
_limit
(string $sql, bool $offsetIgnore = false)
set
($key, $value = '', ?bool $escape = null)
getSetData
(bool $clean = false)
getCompiledSelect
(bool $reset = true)
compileFinalQuery
(string $sql)
get
(?int $limit = null, int $offset = 0, bool $reset = true)
countAll
(bool $reset = true)
countAllResults
(bool $reset = true)
getCompiledQBWhere
()
getWhere
($where = null, ?int $limit = null, ?int $offset = 0, bool $reset = true)
batchExecute
(string $renderMethod, int $batchSize = 100)
setData
($set, ?bool $escape = null, string $alias = '')
getCompiledUpsert
()
upsert
($set = null, ?bool $escape = null)
upsertBatch
($set = null, ?bool $escape = null, int $batchSize = 100)
_upsertBatch
(string $table, array $keys, array $values)
setAlias
(string $alias)
updateFields
($set, bool $addToDefault = false, ?array $ignore = null)
onConstraint
($set)
setQueryAsData
($query, ?string $alias = null, $columns = null)
fieldsFromQuery
(string $sql)
formatValues
(array $values)
insertBatch
($set = null, ?bool $escape = null, int $batchSize = 100)
_insertBatch
(string $table, array $keys, array $values)
setInsertBatch
($key, string $value = '', ?bool $escape = null)
getCompiledInsert
(bool $reset = true)
insert
($set = null, ?bool $escape = null)
removeAlias
(string $from)
validateInsert
()
_insert
(string $table, array $keys, array $unescapedKeys)
replace
(?array $set = null)
_replace
(string $table, array $keys, array $values)
_fromTables
()
getCompiledUpdate
(bool $reset = true)
update
($set = null, $where = null, ?int $limit = null)
_update
(string $table, array $values)
validateUpdate
()
updateBatch
($set = null, $constraints = null, int $batchSize = 100)
_updateBatch
(string $table, array $keys, array $values)
setUpdateBatch
($key, string $index = '', ?bool $escape = null)
emptyTable
()
truncate
()
_truncate
(string $table)
getCompiledDelete
(bool $reset = true)
delete
($where = '', ?int $limit = null, bool $resetData = true)
deleteBatch
($set = null, $constraints = null, int $batchSize = 100)
_deleteBatch
(string $table, array $keys, array $values)
increment
(string $column, int $value = 1)
decrement
(string $column, int $value = 1)
_delete
(string $table)
trackAliases
($table)
compileSelect
($selectOverride = false)
compileIgnore
(string $statement)
compileWhereHaving
(string $qbKey)
compileGroupBy
()
compileOrderBy
()
unionInjection
(string $sql)
objectToArray
($object)
batchObjectToArray
($object)
isLiteral
(string $str)
resetQuery
()
resetRun
(array $qbResetItems)
resetSelect
()
resetWrite
()
hasOperator
(string $str)
getOperator
(string $str, bool $list = false)
getOperatorFromWhereKey
(string $whereKey)
setBind
(string $key, $value = null, bool $escape = true)
cleanClone
()
isSubquery
($value)
buildSubquery
($builder, bool $wrapped = false, string $alias = '')