PHP Класс Illuminate\Database\Query\Builder

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$aggregate array An aggregate function and column to be run.
$columns array The columns that should be returned.
$distinct boolean Indicates if the query returns distinct results.
$from string The table which the query is targeting.
$groups array The groupings for the query.
$havings array The having constraints for the query.
$joins array The table joins for the query.
$limit integer The maximum number of records to return.
$lock string | boolean Indicates whether row locking is being used.
$offset integer The number of records to skip.
$orders array The orderings for the query.
$unionLimit integer The maximum number of union records to return.
$unionOffset integer The number of union records to skip.
$unionOrders array The orderings for the union query.
$unions array The query union statements.
$wheres array The where constraints for the query.

Защищенные свойства (Protected)

Свойство Тип Описание
$backups array The field backups currently in use.
$bindingBackups array The binding backups currently in use.
$bindings array The current query value bindings.
$connection Illuminate\Database\Connection The database connection instance.
$grammar Illuminate\Database\Query\Grammars\Grammar The database query grammar instance.
$operators array All of the available clause operators.
$processor Illuminate\Database\Query\Processors\Processor The database query post processor instance.
$useWritePdo boolean Whether use write pdo for select.

Открытые методы

Метод Описание
__call ( string $method, array $parameters ) : mixed Handle dynamic method calls into the method.
__construct ( Illuminate\Database\ConnectionInterface $connection, Illuminate\Database\Query\Grammars\Grammar $grammar = null, Illuminate\Database\Query\Processors\Processor $processor = null ) : void Create a new query builder instance.
addBinding ( mixed $value, string $type = 'where' ) Add a binding to the query.
addNestedWhereQuery ( Builder | static $query, string $boolean = 'and' ) Add another query builder as a nested where to the query builder.
addSelect ( array | mixed $column ) Add a new select column to the query.
addWhereExistsQuery ( Builder $query, string $boolean = 'and', boolean $not = false ) Add an exists clause to the query.
aggregate ( string $function, array $columns = ['*'] ) : mixed Execute an aggregate function on the database.
average ( string $column ) : mixed Alias for the "avg" method.
avg ( string $column ) : mixed Retrieve the average of the values of a given column.
chunk ( integer $count, callable $callback ) : boolean Chunk the results of the query.
chunkById ( integer $count, callable $callback, string $column = 'id', string $alias = null ) : boolean Chunk the results of a query by comparing numeric IDs.
count ( string $columns = '*' ) : integer Retrieve the "count" result of the query.
crossJoin ( string $table, string $first = null, string $operator = null, string $second = null ) : Builder | static Add a "cross join" clause to the query.
cursor ( ) : Generator Get a generator for the given query.
decrement ( string $column, integer $amount = 1, array $extra = [] ) : integer Decrement a column's value by a given amount.
delete ( mixed $id = null ) : integer Delete a record from the database.
distinct ( ) Force the query to only return distinct results.
dynamicWhere ( string $method, string $parameters ) Handles dynamic "where" clauses to the query.
each ( callable $callback, integer $count = 1000 ) : boolean Execute a callback over each item while chunking.
exists ( ) : boolean Determine if any rows exist for the current query.
find ( integer $id, array $columns = ['*'] ) : mixed | static Execute a query for a single record by ID.
first ( array $columns = ['*'] ) : stdClass | array | null Execute the query and get the first result.
forNestedWhere ( ) : Builder Create a new query instance for nested where condition.
forPage ( integer $page, integer $perPage = 15 ) : Builder | static Set the limit and offset for a given page.
forPageAfterId ( integer $perPage = 15, integer $lastId, string $column = 'id' ) : Builder | static Constrain the query to the next "page" of results after a given ID.
from ( string $table ) Set the table which the query is targeting.
get ( array $columns = ['*'] ) : Collection Execute the query as a "select" statement.
getBindings ( ) : array Get the current query value bindings in a flattened array.
getConnection ( ) : Illuminate\Database\ConnectionInterface Get the database connection instance.
getCountForPagination ( array $columns = ['*'] ) : integer Get the count of the total records for the paginator.
getGrammar ( ) : Illuminate\Database\Query\Grammars\Grammar Get the query grammar instance.
getProcessor ( ) : Illuminate\Database\Query\Processors\Processor Get the database query processor instance.
getRawBindings ( ) : array Get the raw array of bindings.
groupBy ( $groups ) Add a "group by" clause to the query.
having ( string $column, string $operator = null, string $value = null, string $boolean = 'and' ) Add a "having" clause to the query.
havingRaw ( string $sql, array $bindings = [], string $boolean = 'and' ) Add a raw having clause to the query.
implode ( string $column, string $glue = '' ) : string Concatenate values of a given column as a string.
inRandomOrder ( string $seed = '' ) Put the query's results in random order.
increment ( string $column, integer $amount = 1, array $extra = [] ) : integer Increment a column's value by a given amount.
insert ( array $values ) : boolean Insert a new record into the database.
insertGetId ( array $values, string $sequence = null ) : integer Insert a new record and get the value of the primary key.
join ( string $table, string $one, string $operator = null, string $two = null, string $type = 'inner', boolean $where = false ) Add a join clause to the query.
joinWhere ( string $table, string $one, string $operator, string $two, string $type = 'inner' ) : Builder | static Add a "join where" clause to the query.
latest ( string $column = 'created_at' ) : Builder | static Add an "order by" clause for a timestamp to the query.
leftJoin ( string $table, string $first, string $operator = null, string $second = null ) : Builder | static Add a left join to the query.
leftJoinWhere ( string $table, string $one, string $operator, string $two ) : Builder | static Add a "join where" clause to the query.
limit ( integer $value ) Set the "limit" value of the query.
lock ( boolean $value = true ) Lock the selected rows in the table.
lockForUpdate ( ) : Builder Lock the selected rows in the table for updating.
macroCall ( )
max ( string $column ) : mixed Retrieve the maximum value of a given column.
mergeBindings ( Builder $query ) Merge an array of bindings into our bindings.
mergeWheres ( array $wheres, array $bindings ) : void Merge an array of where clauses and bindings.
min ( string $column ) : mixed Retrieve the minimum value of a given column.
newQuery ( ) : Builder Get a new instance of the query builder.
numericAggregate ( string $function, array $columns = ['*'] ) : float | integer Execute a numeric aggregate function on the database.
offset ( integer $value ) Set the "offset" value of the query.
oldest ( string $column = 'created_at' ) : Builder | static Add an "order by" clause for a timestamp to the query.
orHaving ( string $column, string $operator = null, string $value = null ) : Builder | static Add a "or having" clause to the query.
orHavingRaw ( string $sql, array $bindings = [] ) : Builder | static Add a raw or having clause to the query.
orWhere ( Closure | string $column, string $operator = null, mixed $value = null ) : Builder | static Add an "or where" clause to the query.
orWhereBetween ( string $column, array $values ) : Builder | static Add an or where between statement to the query.
orWhereColumn ( string | array $first, string | null $operator = null, string | null $second = null ) : Builder | static Add an "or where" clause comparing two columns to the query.
orWhereDate ( string $column, string $operator, string $value ) : Builder | static Add an "or where date" statement to the query.
orWhereExists ( Closure $callback, boolean $not = false ) : Builder | static Add an or exists clause to the query.
orWhereIn ( string $column, mixed $values ) : Builder | static Add an "or where in" clause to the query.
orWhereNotBetween ( string $column, array $values ) : Builder | static Add an or where not between statement to the query.
orWhereNotExists ( Closure $callback ) : Builder | static Add a where not exists clause to the query.
orWhereNotIn ( string $column, mixed $values ) : Builder | static Add an "or where not in" clause to the query.
orWhereNotNull ( string $column ) : Builder | static Add an "or where not null" clause to the query.
orWhereNull ( string $column ) : Builder | static Add an "or where null" clause to the query.
orWhereRaw ( string $sql, array $bindings = [] ) : Builder | static Add a raw or where clause to the query.
orWhereTime ( string $column, string $operator, integer $value ) : Builder | static Add an "or where time" statement to the query.
orderBy ( string $column, string $direction = 'asc' ) Add an "order by" clause to the query.
orderByRaw ( string $sql, array $bindings = [] ) Add a raw "order by" clause to the query.
paginate ( integer $perPage = 15, array $columns = ['*'], string $pageName = 'page', integer | null $page = null ) : Illuminate\Contracts\Pagination\LengthAwarePaginator Paginate the given query into a simple paginator.
pluck ( string $column, string | null $key = null ) : Collection Get an array with the values of a given column.
raw ( mixed $value ) : Illuminate\Database\Query\Expression Create a raw database expression.
rightJoin ( string $table, string $first, string $operator = null, string $second = null ) : Builder | static Add a right join to the query.
rightJoinWhere ( string $table, string $one, string $operator, string $two ) : Builder | static Add a "right join where" clause to the query.
select ( array | mixed $columns = ['*'] ) Set the columns to be selected.
selectRaw ( string $expression, array $bindings = [] ) : Builder | static Add a new "raw" select expression to the query.
selectSub ( Closure | Builder | string $query, string $as ) : Builder | static Add a subselect expression to the query.
setBindings ( array $bindings, string $type = 'where' ) Set the bindings on the query builder.
sharedLock ( ) : Builder Share lock the selected rows in the table.
simplePaginate ( integer $perPage = 15, array $columns = ['*'], string $pageName = 'page', integer | null $page = null ) : Illuminate\Contracts\Pagination\Paginator Get a paginator only supporting simple next and previous links.
skip ( integer $value ) : Builder | static Alias to set the "offset" value of the query.
sum ( string $column ) : mixed Retrieve the sum of the values of a given column.
take ( integer $value ) : Builder | static Alias to set the "limit" value of the query.
toSql ( ) : string Get the SQL representation of the query.
truncate ( ) : void Run a truncate statement on the table.
union ( Builder | Closure $query, boolean $all = false ) : Builder | static Add a union statement to the query.
unionAll ( Builder | Closure $query ) : Builder | static Add a union all statement to the query.
update ( array $values ) : integer Update a record in the database.
updateOrInsert ( array $attributes, array $values = [] ) : boolean Insert or update a record matching the attributes, and fill it with values.
useWritePdo ( ) Use the write pdo for query.
value ( string $column ) : mixed Get a single column's value from the first result of a query.
when ( boolean $value, Closure $callback, Closure $default = null ) : Builder Apply the callback's query changes if the given "value" is true.
where ( string | array | Closure $column, string $operator = null, mixed $value = null, string $boolean = 'and' ) Add a basic where clause to the query.
whereBetween ( string $column, array $values, string $boolean = 'and', boolean $not = false ) Add a where between statement to the query.
whereColumn ( string | array $first, string | null $operator = null, string | null $second = null, string | null $boolean = 'and' ) : Builder | static Add a "where" clause comparing two columns to the query.
whereDate ( string $column, string $operator, mixed $value = null, string $boolean = 'and' ) : Builder | static Add a "where date" statement to the query.
whereDay ( string $column, string $operator, mixed $value = null, string $boolean = 'and' ) : Builder | static Add a "where day" statement to the query.
whereExists ( Closure $callback, string $boolean = 'and', boolean $not = false ) Add an exists clause to the query.
whereIn ( string $column, mixed $values, string $boolean = 'and', boolean $not = false ) Add a "where in" clause to the query.
whereMonth ( string $column, string $operator, mixed $value = null, string $boolean = 'and' ) : Builder | static Add a "where month" statement to the query.
whereNested ( Closure $callback, string $boolean = 'and' ) : Builder | static Add a nested where statement to the query.
whereNotBetween ( string $column, array $values, string $boolean = 'and' ) : Builder | static Add a where not between statement to the query.
whereNotExists ( Closure $callback, string $boolean = 'and' ) : Builder | static Add a where not exists clause to the query.
whereNotIn ( string $column, mixed $values, string $boolean = 'and' ) : Builder | static Add a "where not in" clause to the query.
whereNotNull ( string $column, string $boolean = 'and' ) : Builder | static Add a "where not null" clause to the query.
whereNull ( string $column, string $boolean = 'and', boolean $not = false ) Add a "where null" clause to the query.
whereRaw ( string $sql, mixed $bindings = [], string $boolean = 'and' ) Add a raw where clause to the query.
whereTime ( string $column, string $operator, integer $value, string $boolean = 'and' ) : Builder | static Add a "where time" statement to the query.
whereYear ( string $column, string $operator, mixed $value = null, string $boolean = 'and' ) : Builder | static Add a "where year" statement to the query.

Защищенные методы

Метод Описание
addArrayOfWheres ( array $column, string $boolean, string $method = 'where' ) Add an array of where clauses to the query.
addDateBasedWhere ( string $type, string $column, string $operator, integer $value, string $boolean = 'and' ) Add a date based (year, month, day, time) statement to the query.
addDynamic ( string $segment, string $connector, array $parameters, integer $index ) : void Add a single dynamic where clause statement to the query.
backupFieldsForCount ( ) : void Backup then remove some fields for the pagination count.
cleanBindings ( array $bindings ) : array Remove all of the expressions from a list of bindings.
clearSelectAliases ( array $columns ) : array Remove the column aliases since they will break count queries.
enforceOrderBy ( ) : void Throw an exception if the query doesn't have an orderBy clause.
invalidOperatorAndValue ( string $operator, mixed $value ) : boolean Determine if the given operator and value combination is legal.
prepareValueAndOperator ( string $value, string $operator, boolean $useDefault = false ) : array Prepare the value and operator for a where clause.
restoreFieldsForCount ( ) : void Restore some fields after the pagination count.
runSelect ( ) : array Run the query as a "select" statement against the connection.
stripTableForPluck ( string $column ) : string | null Strip off the table name or alias from a column identifier.
whereInExistingQuery ( string $column, Builder | static $query, string $boolean, boolean $not ) Add an external sub-select to the query.
whereInSub ( string $column, Closure $callback, string $boolean, boolean $not ) Add a where in with a sub-select to the query.
whereSub ( string $column, string $operator, Closure $callback, string $boolean ) Add a full sub-select to the query.

Описание методов

__call() публичный метод

Handle dynamic method calls into the method.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
Результат mixed

__construct() публичный метод

Create a new query builder instance.
public __construct ( Illuminate\Database\ConnectionInterface $connection, Illuminate\Database\Query\Grammars\Grammar $grammar = null, Illuminate\Database\Query\Processors\Processor $processor = null ) : void
$connection Illuminate\Database\ConnectionInterface
$grammar Illuminate\Database\Query\Grammars\Grammar
$processor Illuminate\Database\Query\Processors\Processor
Результат void

addArrayOfWheres() защищенный метод

Add an array of where clauses to the query.
protected addArrayOfWheres ( array $column, string $boolean, string $method = 'where' )
$column array
$boolean string
$method string

addBinding() публичный метод

Add a binding to the query.
public addBinding ( mixed $value, string $type = 'where' )
$value mixed
$type string

addDateBasedWhere() защищенный метод

Add a date based (year, month, day, time) statement to the query.
protected addDateBasedWhere ( string $type, string $column, string $operator, integer $value, string $boolean = 'and' )
$type string
$column string
$operator string
$value integer
$boolean string

addDynamic() защищенный метод

Add a single dynamic where clause statement to the query.
protected addDynamic ( string $segment, string $connector, array $parameters, integer $index ) : void
$segment string
$connector string
$parameters array
$index integer
Результат void

addNestedWhereQuery() публичный метод

Add another query builder as a nested where to the query builder.
public addNestedWhereQuery ( Builder | static $query, string $boolean = 'and' )
$query Builder | static
$boolean string

addSelect() публичный метод

Add a new select column to the query.
public addSelect ( array | mixed $column )
$column array | mixed

addWhereExistsQuery() публичный метод

Add an exists clause to the query.
public addWhereExistsQuery ( Builder $query, string $boolean = 'and', boolean $not = false )
$query Builder
$boolean string
$not boolean

aggregate() публичный метод

Execute an aggregate function on the database.
public aggregate ( string $function, array $columns = ['*'] ) : mixed
$function string
$columns array
Результат mixed

average() публичный метод

Alias for the "avg" method.
public average ( string $column ) : mixed
$column string
Результат mixed

avg() публичный метод

Retrieve the average of the values of a given column.
public avg ( string $column ) : mixed
$column string
Результат mixed

backupFieldsForCount() защищенный метод

Backup then remove some fields for the pagination count.
protected backupFieldsForCount ( ) : void
Результат void

chunk() публичный метод

Chunk the results of the query.
public chunk ( integer $count, callable $callback ) : boolean
$count integer
$callback callable
Результат boolean

chunkById() публичный метод

Chunk the results of a query by comparing numeric IDs.
public chunkById ( integer $count, callable $callback, string $column = 'id', string $alias = null ) : boolean
$count integer
$callback callable
$column string
$alias string
Результат boolean

cleanBindings() защищенный метод

Remove all of the expressions from a list of bindings.
protected cleanBindings ( array $bindings ) : array
$bindings array
Результат array

clearSelectAliases() защищенный метод

Remove the column aliases since they will break count queries.
protected clearSelectAliases ( array $columns ) : array
$columns array
Результат array

count() публичный метод

Retrieve the "count" result of the query.
public count ( string $columns = '*' ) : integer
$columns string
Результат integer

crossJoin() публичный метод

Add a "cross join" clause to the query.
public crossJoin ( string $table, string $first = null, string $operator = null, string $second = null ) : Builder | static
$table string
$first string
$operator string
$second string
Результат Builder | static

cursor() публичный метод

Get a generator for the given query.
public cursor ( ) : Generator
Результат Generator

decrement() публичный метод

Decrement a column's value by a given amount.
public decrement ( string $column, integer $amount = 1, array $extra = [] ) : integer
$column string
$amount integer
$extra array
Результат integer

delete() публичный метод

Delete a record from the database.
public delete ( mixed $id = null ) : integer
$id mixed
Результат integer

distinct() публичный метод

Force the query to only return distinct results.
public distinct ( )

dynamicWhere() публичный метод

Handles dynamic "where" clauses to the query.
public dynamicWhere ( string $method, string $parameters )
$method string
$parameters string

each() публичный метод

Execute a callback over each item while chunking.
public each ( callable $callback, integer $count = 1000 ) : boolean
$callback callable
$count integer
Результат boolean

enforceOrderBy() защищенный метод

Throw an exception if the query doesn't have an orderBy clause.
protected enforceOrderBy ( ) : void
Результат void

exists() публичный метод

Determine if any rows exist for the current query.
public exists ( ) : boolean
Результат boolean

find() публичный метод

Execute a query for a single record by ID.
public find ( integer $id, array $columns = ['*'] ) : mixed | static
$id integer
$columns array
Результат mixed | static

first() публичный метод

Execute the query and get the first result.
public first ( array $columns = ['*'] ) : stdClass | array | null
$columns array
Результат stdClass | array | null

forNestedWhere() публичный метод

Create a new query instance for nested where condition.
public forNestedWhere ( ) : Builder
Результат Builder

forPage() публичный метод

Set the limit and offset for a given page.
public forPage ( integer $page, integer $perPage = 15 ) : Builder | static
$page integer
$perPage integer
Результат Builder | static

forPageAfterId() публичный метод

Constrain the query to the next "page" of results after a given ID.
public forPageAfterId ( integer $perPage = 15, integer $lastId, string $column = 'id' ) : Builder | static
$perPage integer
$lastId integer
$column string
Результат Builder | static

from() публичный метод

Set the table which the query is targeting.
public from ( string $table )
$table string

get() публичный метод

Execute the query as a "select" statement.
public get ( array $columns = ['*'] ) : Collection
$columns array
Результат Illuminate\Support\Collection

getBindings() публичный метод

Get the current query value bindings in a flattened array.
public getBindings ( ) : array
Результат array

getConnection() публичный метод

Get the database connection instance.
public getConnection ( ) : Illuminate\Database\ConnectionInterface
Результат Illuminate\Database\ConnectionInterface

getCountForPagination() публичный метод

Get the count of the total records for the paginator.
public getCountForPagination ( array $columns = ['*'] ) : integer
$columns array
Результат integer

getGrammar() публичный метод

Get the query grammar instance.
public getGrammar ( ) : Illuminate\Database\Query\Grammars\Grammar
Результат Illuminate\Database\Query\Grammars\Grammar

getProcessor() публичный метод

Get the database query processor instance.
public getProcessor ( ) : Illuminate\Database\Query\Processors\Processor
Результат Illuminate\Database\Query\Processors\Processor

getRawBindings() публичный метод

Get the raw array of bindings.
public getRawBindings ( ) : array
Результат array

groupBy() публичный метод

Add a "group by" clause to the query.
public groupBy ( $groups )
$groups

having() публичный метод

Add a "having" clause to the query.
public having ( string $column, string $operator = null, string $value = null, string $boolean = 'and' )
$column string
$operator string
$value string
$boolean string

havingRaw() публичный метод

Add a raw having clause to the query.
public havingRaw ( string $sql, array $bindings = [], string $boolean = 'and' )
$sql string
$bindings array
$boolean string

implode() публичный метод

Concatenate values of a given column as a string.
public implode ( string $column, string $glue = '' ) : string
$column string
$glue string
Результат string

inRandomOrder() публичный метод

Put the query's results in random order.
public inRandomOrder ( string $seed = '' )
$seed string

increment() публичный метод

Increment a column's value by a given amount.
public increment ( string $column, integer $amount = 1, array $extra = [] ) : integer
$column string
$amount integer
$extra array
Результат integer

insert() публичный метод

Insert a new record into the database.
public insert ( array $values ) : boolean
$values array
Результат boolean

insertGetId() публичный метод

Insert a new record and get the value of the primary key.
public insertGetId ( array $values, string $sequence = null ) : integer
$values array
$sequence string
Результат integer

invalidOperatorAndValue() защищенный метод

Determine if the given operator and value combination is legal.
protected invalidOperatorAndValue ( string $operator, mixed $value ) : boolean
$operator string
$value mixed
Результат boolean

join() публичный метод

Add a join clause to the query.
public join ( string $table, string $one, string $operator = null, string $two = null, string $type = 'inner', boolean $where = false )
$table string
$one string
$operator string
$two string
$type string
$where boolean

joinWhere() публичный метод

Add a "join where" clause to the query.
public joinWhere ( string $table, string $one, string $operator, string $two, string $type = 'inner' ) : Builder | static
$table string
$one string
$operator string
$two string
$type string
Результат Builder | static

latest() публичный метод

Add an "order by" clause for a timestamp to the query.
public latest ( string $column = 'created_at' ) : Builder | static
$column string
Результат Builder | static

leftJoin() публичный метод

Add a left join to the query.
public leftJoin ( string $table, string $first, string $operator = null, string $second = null ) : Builder | static
$table string
$first string
$operator string
$second string
Результат Builder | static

leftJoinWhere() публичный метод

Add a "join where" clause to the query.
public leftJoinWhere ( string $table, string $one, string $operator, string $two ) : Builder | static
$table string
$one string
$operator string
$two string
Результат Builder | static

limit() публичный метод

Set the "limit" value of the query.
public limit ( integer $value )
$value integer

lock() публичный метод

Lock the selected rows in the table.
public lock ( boolean $value = true )
$value boolean

lockForUpdate() публичный метод

Lock the selected rows in the table for updating.
public lockForUpdate ( ) : Builder
Результат Builder

macroCall() публичный метод

public macroCall ( )

max() публичный метод

Retrieve the maximum value of a given column.
public max ( string $column ) : mixed
$column string
Результат mixed

mergeBindings() публичный метод

Merge an array of bindings into our bindings.
public mergeBindings ( Builder $query )
$query Builder

mergeWheres() публичный метод

Merge an array of where clauses and bindings.
public mergeWheres ( array $wheres, array $bindings ) : void
$wheres array
$bindings array
Результат void

min() публичный метод

Retrieve the minimum value of a given column.
public min ( string $column ) : mixed
$column string
Результат mixed

newQuery() публичный метод

Get a new instance of the query builder.
public newQuery ( ) : Builder
Результат Builder

numericAggregate() публичный метод

Execute a numeric aggregate function on the database.
public numericAggregate ( string $function, array $columns = ['*'] ) : float | integer
$function string
$columns array
Результат float | integer

offset() публичный метод

Set the "offset" value of the query.
public offset ( integer $value )
$value integer

oldest() публичный метод

Add an "order by" clause for a timestamp to the query.
public oldest ( string $column = 'created_at' ) : Builder | static
$column string
Результат Builder | static

orHaving() публичный метод

Add a "or having" clause to the query.
public orHaving ( string $column, string $operator = null, string $value = null ) : Builder | static
$column string
$operator string
$value string
Результат Builder | static

orHavingRaw() публичный метод

Add a raw or having clause to the query.
public orHavingRaw ( string $sql, array $bindings = [] ) : Builder | static
$sql string
$bindings array
Результат Builder | static

orWhere() публичный метод

Add an "or where" clause to the query.
public orWhere ( Closure | string $column, string $operator = null, mixed $value = null ) : Builder | static
$column Closure | string
$operator string
$value mixed
Результат Builder | static

orWhereBetween() публичный метод

Add an or where between statement to the query.
public orWhereBetween ( string $column, array $values ) : Builder | static
$column string
$values array
Результат Builder | static

orWhereColumn() публичный метод

Add an "or where" clause comparing two columns to the query.
public orWhereColumn ( string | array $first, string | null $operator = null, string | null $second = null ) : Builder | static
$first string | array
$operator string | null
$second string | null
Результат Builder | static

orWhereDate() публичный метод

Add an "or where date" statement to the query.
public orWhereDate ( string $column, string $operator, string $value ) : Builder | static
$column string
$operator string
$value string
Результат Builder | static

orWhereExists() публичный метод

Add an or exists clause to the query.
public orWhereExists ( Closure $callback, boolean $not = false ) : Builder | static
$callback Closure
$not boolean
Результат Builder | static

orWhereIn() публичный метод

Add an "or where in" clause to the query.
public orWhereIn ( string $column, mixed $values ) : Builder | static
$column string
$values mixed
Результат Builder | static

orWhereNotBetween() публичный метод

Add an or where not between statement to the query.
public orWhereNotBetween ( string $column, array $values ) : Builder | static
$column string
$values array
Результат Builder | static

orWhereNotExists() публичный метод

Add a where not exists clause to the query.
public orWhereNotExists ( Closure $callback ) : Builder | static
$callback Closure
Результат Builder | static

orWhereNotIn() публичный метод

Add an "or where not in" clause to the query.
public orWhereNotIn ( string $column, mixed $values ) : Builder | static
$column string
$values mixed
Результат Builder | static

orWhereNotNull() публичный метод

Add an "or where not null" clause to the query.
public orWhereNotNull ( string $column ) : Builder | static
$column string
Результат Builder | static

orWhereNull() публичный метод

Add an "or where null" clause to the query.
public orWhereNull ( string $column ) : Builder | static
$column string
Результат Builder | static

orWhereRaw() публичный метод

Add a raw or where clause to the query.
public orWhereRaw ( string $sql, array $bindings = [] ) : Builder | static
$sql string
$bindings array
Результат Builder | static

orWhereTime() публичный метод

Add an "or where time" statement to the query.
public orWhereTime ( string $column, string $operator, integer $value ) : Builder | static
$column string
$operator string
$value integer
Результат Builder | static

orderBy() публичный метод

Add an "order by" clause to the query.
public orderBy ( string $column, string $direction = 'asc' )
$column string
$direction string

orderByRaw() публичный метод

Add a raw "order by" clause to the query.
public orderByRaw ( string $sql, array $bindings = [] )
$sql string
$bindings array

paginate() публичный метод

Paginate the given query into a simple paginator.
public paginate ( integer $perPage = 15, array $columns = ['*'], string $pageName = 'page', integer | null $page = null ) : Illuminate\Contracts\Pagination\LengthAwarePaginator
$perPage integer
$columns array
$pageName string
$page integer | null
Результат Illuminate\Contracts\Pagination\LengthAwarePaginator

pluck() публичный метод

Get an array with the values of a given column.
public pluck ( string $column, string | null $key = null ) : Collection
$column string
$key string | null
Результат Illuminate\Support\Collection

prepareValueAndOperator() защищенный метод

Prepare the value and operator for a where clause.
protected prepareValueAndOperator ( string $value, string $operator, boolean $useDefault = false ) : array
$value string
$operator string
$useDefault boolean
Результат array

raw() публичный метод

Create a raw database expression.
public raw ( mixed $value ) : Illuminate\Database\Query\Expression
$value mixed
Результат Illuminate\Database\Query\Expression

restoreFieldsForCount() защищенный метод

Restore some fields after the pagination count.
protected restoreFieldsForCount ( ) : void
Результат void

rightJoin() публичный метод

Add a right join to the query.
public rightJoin ( string $table, string $first, string $operator = null, string $second = null ) : Builder | static
$table string
$first string
$operator string
$second string
Результат Builder | static

rightJoinWhere() публичный метод

Add a "right join where" clause to the query.
public rightJoinWhere ( string $table, string $one, string $operator, string $two ) : Builder | static
$table string
$one string
$operator string
$two string
Результат Builder | static

runSelect() защищенный метод

Run the query as a "select" statement against the connection.
protected runSelect ( ) : array
Результат array

select() публичный метод

Set the columns to be selected.
public select ( array | mixed $columns = ['*'] )
$columns array | mixed

selectRaw() публичный метод

Add a new "raw" select expression to the query.
public selectRaw ( string $expression, array $bindings = [] ) : Builder | static
$expression string
$bindings array
Результат Builder | static

selectSub() публичный метод

Add a subselect expression to the query.
public selectSub ( Closure | Builder | string $query, string $as ) : Builder | static
$query Closure | Builder | string
$as string
Результат Builder | static

setBindings() публичный метод

Set the bindings on the query builder.
public setBindings ( array $bindings, string $type = 'where' )
$bindings array
$type string

sharedLock() публичный метод

Share lock the selected rows in the table.
public sharedLock ( ) : Builder
Результат Builder

simplePaginate() публичный метод

This is more efficient on larger data-sets, etc.
public simplePaginate ( integer $perPage = 15, array $columns = ['*'], string $pageName = 'page', integer | null $page = null ) : Illuminate\Contracts\Pagination\Paginator
$perPage integer
$columns array
$pageName string
$page integer | null
Результат Illuminate\Contracts\Pagination\Paginator

skip() публичный метод

Alias to set the "offset" value of the query.
public skip ( integer $value ) : Builder | static
$value integer
Результат Builder | static

stripTableForPluck() защищенный метод

Strip off the table name or alias from a column identifier.
protected stripTableForPluck ( string $column ) : string | null
$column string
Результат string | null

sum() публичный метод

Retrieve the sum of the values of a given column.
public sum ( string $column ) : mixed
$column string
Результат mixed

take() публичный метод

Alias to set the "limit" value of the query.
public take ( integer $value ) : Builder | static
$value integer
Результат Builder | static

toSql() публичный метод

Get the SQL representation of the query.
public toSql ( ) : string
Результат string

truncate() публичный метод

Run a truncate statement on the table.
public truncate ( ) : void
Результат void

union() публичный метод

Add a union statement to the query.
public union ( Builder | Closure $query, boolean $all = false ) : Builder | static
$query Builder | Closure
$all boolean
Результат Builder | static

unionAll() публичный метод

Add a union all statement to the query.
public unionAll ( Builder | Closure $query ) : Builder | static
$query Builder | Closure
Результат Builder | static

update() публичный метод

Update a record in the database.
public update ( array $values ) : integer
$values array
Результат integer

updateOrInsert() публичный метод

Insert or update a record matching the attributes, and fill it with values.
public updateOrInsert ( array $attributes, array $values = [] ) : boolean
$attributes array
$values array
Результат boolean

useWritePdo() публичный метод

Use the write pdo for query.
public useWritePdo ( )

value() публичный метод

Get a single column's value from the first result of a query.
public value ( string $column ) : mixed
$column string
Результат mixed

when() публичный метод

Apply the callback's query changes if the given "value" is true.
public when ( boolean $value, Closure $callback, Closure $default = null ) : Builder
$value boolean
$callback Closure
$default Closure
Результат Builder

where() публичный метод

Add a basic where clause to the query.
public where ( string | array | Closure $column, string $operator = null, mixed $value = null, string $boolean = 'and' )
$column string | array | Closure
$operator string
$value mixed
$boolean string

whereBetween() публичный метод

Add a where between statement to the query.
public whereBetween ( string $column, array $values, string $boolean = 'and', boolean $not = false )
$column string
$values array
$boolean string
$not boolean

whereColumn() публичный метод

Add a "where" clause comparing two columns to the query.
public whereColumn ( string | array $first, string | null $operator = null, string | null $second = null, string | null $boolean = 'and' ) : Builder | static
$first string | array
$operator string | null
$second string | null
$boolean string | null
Результат Builder | static

whereDate() публичный метод

Add a "where date" statement to the query.
public whereDate ( string $column, string $operator, mixed $value = null, string $boolean = 'and' ) : Builder | static
$column string
$operator string
$value mixed
$boolean string
Результат Builder | static

whereDay() публичный метод

Add a "where day" statement to the query.
public whereDay ( string $column, string $operator, mixed $value = null, string $boolean = 'and' ) : Builder | static
$column string
$operator string
$value mixed
$boolean string
Результат Builder | static

whereExists() публичный метод

Add an exists clause to the query.
public whereExists ( Closure $callback, string $boolean = 'and', boolean $not = false )
$callback Closure
$boolean string
$not boolean

whereIn() публичный метод

Add a "where in" clause to the query.
public whereIn ( string $column, mixed $values, string $boolean = 'and', boolean $not = false )
$column string
$values mixed
$boolean string
$not boolean

whereInExistingQuery() защищенный метод

Add an external sub-select to the query.
protected whereInExistingQuery ( string $column, Builder | static $query, string $boolean, boolean $not )
$column string
$query Builder | static
$boolean string
$not boolean

whereInSub() защищенный метод

Add a where in with a sub-select to the query.
protected whereInSub ( string $column, Closure $callback, string $boolean, boolean $not )
$column string
$callback Closure
$boolean string
$not boolean

whereMonth() публичный метод

Add a "where month" statement to the query.
public whereMonth ( string $column, string $operator, mixed $value = null, string $boolean = 'and' ) : Builder | static
$column string
$operator string
$value mixed
$boolean string
Результат Builder | static

whereNested() публичный метод

Add a nested where statement to the query.
public whereNested ( Closure $callback, string $boolean = 'and' ) : Builder | static
$callback Closure
$boolean string
Результат Builder | static

whereNotBetween() публичный метод

Add a where not between statement to the query.
public whereNotBetween ( string $column, array $values, string $boolean = 'and' ) : Builder | static
$column string
$values array
$boolean string
Результат Builder | static

whereNotExists() публичный метод

Add a where not exists clause to the query.
public whereNotExists ( Closure $callback, string $boolean = 'and' ) : Builder | static
$callback Closure
$boolean string
Результат Builder | static

whereNotIn() публичный метод

Add a "where not in" clause to the query.
public whereNotIn ( string $column, mixed $values, string $boolean = 'and' ) : Builder | static
$column string
$values mixed
$boolean string
Результат Builder | static

whereNotNull() публичный метод

Add a "where not null" clause to the query.
public whereNotNull ( string $column, string $boolean = 'and' ) : Builder | static
$column string
$boolean string
Результат Builder | static

whereNull() публичный метод

Add a "where null" clause to the query.
public whereNull ( string $column, string $boolean = 'and', boolean $not = false )
$column string
$boolean string
$not boolean

whereRaw() публичный метод

Add a raw where clause to the query.
public whereRaw ( string $sql, mixed $bindings = [], string $boolean = 'and' )
$sql string
$bindings mixed
$boolean string

whereSub() защищенный метод

Add a full sub-select to the query.
protected whereSub ( string $column, string $operator, Closure $callback, string $boolean )
$column string
$operator string
$callback Closure
$boolean string

whereTime() публичный метод

Add a "where time" statement to the query.
public whereTime ( string $column, string $operator, integer $value, string $boolean = 'and' ) : Builder | static
$column string
$operator string
$value integer
$boolean string
Результат Builder | static

whereYear() публичный метод

Add a "where year" statement to the query.
public whereYear ( string $column, string $operator, mixed $value = null, string $boolean = 'and' ) : Builder | static
$column string
$operator string
$value mixed
$boolean string
Результат Builder | static

Описание свойств

$aggregate публичное свойство

An aggregate function and column to be run.
public array $aggregate
Результат array

$backups защищенное свойство

The field backups currently in use.
protected array $backups
Результат array

$bindingBackups защищенное свойство

The binding backups currently in use.
protected array $bindingBackups
Результат array

$bindings защищенное свойство

The current query value bindings.
protected array $bindings
Результат array

$columns публичное свойство

The columns that should be returned.
public array $columns
Результат array

$connection защищенное свойство

The database connection instance.
protected Connection,Illuminate\Database $connection
Результат Illuminate\Database\Connection

$distinct публичное свойство

Indicates if the query returns distinct results.
public bool $distinct
Результат boolean

$from публичное свойство

The table which the query is targeting.
public string $from
Результат string

$grammar защищенное свойство

The database query grammar instance.
protected Grammar,Illuminate\Database\Query\Grammars $grammar
Результат Illuminate\Database\Query\Grammars\Grammar

$groups публичное свойство

The groupings for the query.
public array $groups
Результат array

$havings публичное свойство

The having constraints for the query.
public array $havings
Результат array

$joins публичное свойство

The table joins for the query.
public array $joins
Результат array

$limit публичное свойство

The maximum number of records to return.
public int $limit
Результат integer

$lock публичное свойство

Indicates whether row locking is being used.
public string|bool $lock
Результат string | boolean

$offset публичное свойство

The number of records to skip.
public int $offset
Результат integer

$operators защищенное свойство

All of the available clause operators.
protected array $operators
Результат array

$orders публичное свойство

The orderings for the query.
public array $orders
Результат array

$processor защищенное свойство

The database query post processor instance.
protected Processor,Illuminate\Database\Query\Processors $processor
Результат Illuminate\Database\Query\Processors\Processor

$unionLimit публичное свойство

The maximum number of union records to return.
public int $unionLimit
Результат integer

$unionOffset публичное свойство

The number of union records to skip.
public int $unionOffset
Результат integer

$unionOrders публичное свойство

The orderings for the union query.
public array $unionOrders
Результат array

$unions публичное свойство

The query union statements.
public array $unions
Результат array

$useWritePdo защищенное свойство

Whether use write pdo for select.
protected bool $useWritePdo
Результат boolean

$wheres публичное свойство

The where constraints for the query.
public array $wheres
Результат array