BuildsQueries (Database\Concerns)

BuildsQueries

trait BuildsQueries (View source)

Methods

bool chunk(int $count, callable $callback)

Chunk the results of the query.

bool each(callable $callback, int $count = 1000)

Execute a callback over each item while chunking.

mixed first(array $columns = array('*'))

Execute the query and get the first result.

mixed when(mixed $value, callable $callback, callable $default = null)

Apply the callback's query changes if the given "value" is true.

mixed unless(mixed $value, callable $callback, callable $default = null)

Apply the callback's query changes if the given "value" is false.

Details

bool chunk(int $count, callable $callback)

Chunk the results of the query.

Parameters

int $count
callable $callback

Return Value

bool

bool each(callable $callback, int $count = 1000)

Execute a callback over each item while chunking.

Parameters

callable $callback
int $count

Return Value

bool

mixed first(array $columns = array('*'))

Execute the query and get the first result.

Parameters

array $columns

Return Value

mixed

mixed when(mixed $value, callable $callback, callable $default = null)

Apply the callback's query changes if the given "value" is true.

Parameters

mixed $value
callable $callback
callable $default

Return Value

mixed

mixed unless(mixed $value, callable $callback, callable $default = null)

Apply the callback's query changes if the given "value" is false.

Parameters

mixed $value
callable $callback
callable $default

Return Value

mixed

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.4/Illuminate/Database/Concerns/BuildsQueries.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部