QueryBuilder
final class QueryBuilder (View source)
Methods
table(string $table)
from(string $table)
fromRaw(string $sql, array $bindings = [])
select(string|array $columns = '*')
selectSubquery(QueryBuilder $query, string $alias)
fromSubquery(QueryBuilder $query, string $alias)
selectRaw(string $sql, array $bindings = [])
distinct(bool $state = true)
join(string $table, string $condition, string $type = 'INNER')
joinSubquery(QueryBuilder $query, string $alias, string $condition, string $type = 'INNER')
leftJoinSubquery(QueryBuilder $query, string $alias, string $condition)
where(string|array $column, mixed $value = null)
orWhere(string|array $column, mixed $value = null)
where_like(string $column, string $value, string $side = 'both')
whereLike(string $column, string $value, string $side = 'both')
or_where_like(string $column, string $value, string $side = 'both')
orWhereLike(string $column, string $value, string $side = 'both')
where_not_like(string $column, string $value, string $side = 'both')
whereNotLike(string $column, string $value, string $side = 'both')
or_where_not_like(string $column, string $value, string $side = 'both')
orWhereNotLike(string $column, string $value, string $side = 'both')
where_in(string $column, array $values)
whereIn(string $column, array $values)
where_not_in(string $column, array $values)
whereNotIn(string $column, array $values)
or_where_in(string $column, array $values)
orWhereIn(string $column, array $values)
or_where_not_in(string $column, array $values)
orWhereNotIn(string $column, array $values)
whereInSubquery(string $column, QueryBuilder $query)
whereNotInSubquery(string $column, QueryBuilder $query)
orWhereInSubquery(string $column, QueryBuilder $query)
orWhereNotInSubquery(string $column, QueryBuilder $query)
where_null(string $column)
whereNull(string $column)
where_not_null(string $column)
whereNotNull(string $column)
or_where_null(string $column)
orWhereNull(string $column)
or_where_not_null(string $column)
orWhereNotNull(string $column)
where_between(string $column, mixed $from, mixed $to)
whereBetween(string $column, mixed $from, mixed $to)
where_not_between(string $column, mixed $from, mixed $to)
whereNotBetween(string $column, mixed $from, mixed $to)
or_where_between(string $column, mixed $from, mixed $to)
orWhereBetween(string $column, mixed $from, mixed $to)
or_where_not_between(string $column, mixed $from, mixed $to)
orWhereNotBetween(string $column, mixed $from, mixed $to)
when(bool $condition, callable $then, callable|null $else = null)
whereRaw(string $sql, array $bindings = [])
orWhereRaw(string $sql, array $bindings = [])
order_by(string $column, string $direction = 'ASC')
orderBy(string $column, string $direction = 'ASC')
group_by(string|array $columns)
groupBy(string|array $columns)
having(string|array $column, mixed $value = null)
orHaving(string|array $column, mixed $value = null)
havingRaw(string $sql, array $bindings = [])
orHavingRaw(string $sql, array $bindings = [])
havingIn(string $column, array $values)
orHavingIn(string $column, array $values)
havingNotIn(string $column, array $values)
orHavingNotIn(string $column, array $values)
havingBetween(string $column, mixed $from, mixed $to)
orHavingBetween(string $column, mixed $from, mixed $to)
havingNotBetween(string $column, mixed $from, mixed $to)
orHavingNotBetween(string $column, mixed $from, mixed $to)
limit(int $limit, int $offset = 0)
offset(int $offset)
union(QueryBuilder $query)
unionAll(QueryBuilder $query)
set(array $data)
get(int|null $limit = null, int $offset = 0)
getArray(int|null $limit = null, int $offset = 0)
array
exists()
bool
bool
value(string $column)
mixed
pluck(string $column, string|null $key = null)
array
first()
array|null
int
int
insert(array|null $data = null)
bool
batch_insert(array $rows)
bool
batchInsert(array $rows)
bool
insertOrIgnore(array $rows)
bool
upsert(array $rows, array $updateColumns = [])
bool
update(array|null $data = null)
bool
increment(string $column, int|float $amount = 1)
bool
decrement(string $column, int|float $amount = 1)
bool
batch_update(array $rows, string $index)
bool
batchUpdate(array $rows, string $index)
bool
delete(array $where = [])
bool
Details
joinSubquery
QueryBuilder
joinSubquery(QueryBuilder $query, string $alias, string $condition, string $type = 'INNER')
No description
leftJoinSubquery
QueryBuilder
leftJoinSubquery(QueryBuilder $query, string $alias, string $condition)
No description
where_like
QueryBuilder
where_like(string $column, string $value, string $side = 'both')
No description
whereLike
QueryBuilder
whereLike(string $column, string $value, string $side = 'both')
No description
or_where_like
QueryBuilder
or_where_like(string $column, string $value, string $side = 'both')
No description
orWhereLike
QueryBuilder
orWhereLike(string $column, string $value, string $side = 'both')
No description
where_not_like
QueryBuilder
where_not_like(string $column, string $value, string $side = 'both')
No description
whereNotLike
QueryBuilder
whereNotLike(string $column, string $value, string $side = 'both')
No description
or_where_not_like
QueryBuilder
or_where_not_like(string $column, string $value, string $side = 'both')
No description
orWhereNotLike
QueryBuilder
orWhereNotLike(string $column, string $value, string $side = 'both')
No description
whereNotInSubquery
QueryBuilder
whereNotInSubquery(string $column, QueryBuilder $query)
No description
orWhereInSubquery
QueryBuilder
orWhereInSubquery(string $column, QueryBuilder $query)
No description
orWhereNotInSubquery
QueryBuilder
orWhereNotInSubquery(string $column, QueryBuilder $query)
No description
where_not_between
QueryBuilder
where_not_between(string $column, mixed $from, mixed $to)
No description
or_where_between
QueryBuilder
or_where_between(string $column, mixed $from, mixed $to)
No description
or_where_not_between
QueryBuilder
or_where_not_between(string $column, mixed $from, mixed $to)
No description
orWhereNotBetween
QueryBuilder
orWhereNotBetween(string $column, mixed $from, mixed $to)
No description
havingNotBetween
QueryBuilder
havingNotBetween(string $column, mixed $from, mixed $to)
No description
orHavingNotBetween
QueryBuilder
orHavingNotBetween(string $column, mixed $from, mixed $to)
No description
getArray
array
getArray(int|null $limit = null, int $offset = 0)
No description
exists
bool
exists()
No description
doesntExist
bool
doesntExist()
No description
value
mixed
value(string $column)
No description
pluck
array
pluck(string $column, string|null $key = null)
No description
first
array|null
first()
No description
count_all_results
int
count_all_results()
No description
countAllResults
int
countAllResults()
No description
insert
bool
insert(array|null $data = null)
No description
batch_insert
bool
batch_insert(array $rows)
No description
batchInsert
bool
batchInsert(array $rows)
No description
insertOrIgnore
bool
insertOrIgnore(array $rows)
No description
upsert
bool
upsert(array $rows, array $updateColumns = [])
No description
update
bool
update(array|null $data = null)
No description
increment
bool
increment(string $column, int|float $amount = 1)
No description
decrement
bool
decrement(string $column, int|float $amount = 1)
No description
batch_update
bool
batch_update(array $rows, string $index)
No description
batchUpdate
bool
batchUpdate(array $rows, string $index)
No description
delete
bool
delete(array $where = [])
No description