PHP 클래스 Illuminate\Database\Query\Builder

파일 보기 프로젝트 열기: illuminate/database 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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.

보호된 프로퍼티들

프로퍼티 타입 설명
$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