Spec-Zone.ru › Laravel 5.5

QueriesRelationships

трейт QueriesRelationships (View source)

Методы

Builder|QueriesRelationships has(string $relation, string $operator = '>=', int $count = 1, string $boolean = 'and', Closure $callback = null)

Добавить условие подсчета/существования связи к запросу.

Builder|QueriesRelationships hasNested(string $relations, string $operator = '>=', int $count = 1, string $boolean = 'and', Closure|null $callback = null)

Добавить условия подсчета/существования вложенных связей к запросу.

Builder|QueriesRelationships orHas(string $relation, string $operator = '>=', int $count = 1)

Добавить условие подсчета/существования связи к запросу с "или".

Builder|QueriesRelationships doesntHave(string $relation, string $boolean = 'and', Closure $callback = null)

Добавить условие подсчета/существования связи к запросу.

Builder|QueriesRelationships orDoesntHave(string $relation)

Добавить условие подсчета/существования связи к запросу с "или".

Builder|QueriesRelationships whereHas(string $relation, Closure $callback = null, string $operator = '>=', int $count = 1)

Добавить условие подсчета/существования связи к запросу с where-условиями.

Builder|QueriesRelationships orWhereHas(string $relation, Closure $callback = null, string $operator = '>=', int $count = 1)

Добавить условие подсчета/существования связи к запросу с where-условиями и "или".

Builder|QueriesRelationships whereDoesntHave(string $relation, Closure $callback = null)

Добавить условие подсчета/существования связи к запросу с where-условиями.

Builder|QueriesRelationships orWhereDoesntHave(string $relation, Closure $callback = null)

Добавить условие подсчета/существования связи к запросу с where-условиями и "или".

$this withCount(mixed $relations)

Добавить подзапросы для подсчета связей.

Builder|QueriesRelationships addHasWhere(Builder $hasQuery, Relation $relation, string $operator, int $count, string $boolean)

Добавить where-условие "has" к запросу.

Builder|QueriesRelationships mergeConstraintsFrom(Builder $from)

Объединить where-условия из другого запроса с текущим запросом.

$this addWhereCountQuery(Builder $query, string $operator = '>=', int $count = 1, string $boolean = 'and')

Добавить подзапрос для подсчета к этому запросу.

Relation getRelationWithoutConstraints(string $relation)

Получить базовый запрос "has relation".

bool canUseExistsForExistenceCheck(string $operator, int $count)

Проверить, можно ли запустить запрос "exists" для оптимизации производительности.

Подробности

Builder|QueriesRelationships has(string $relation, string $operator = '>=', int $count = 1, string $boolean = 'and', Closure $callback = null)

Добавить условие подсчета/существования связи к запросу.

Параметры

string $relation
string $operator
int $count
string $boolean
Closure $callback

Возвращаемое значение

Builder|QueriesRelationships

protected Builder|QueriesRelationships hasNested(string $relations, string $operator = '>=', int $count = 1, string $boolean = 'and', Closure|null $callback = null)

Добавить условия подсчета/существования вложенных связей к запросу.

Настраивает рекурсивный вызов whereHas, пока не будет завершена вложенная связь.

Параметры

string $relations
string $operator
int $count
string $boolean
Closure|null $callback

Возвращаемое значение

Builder|QueriesRelationships

Builder|QueriesRelationships orHas(string $relation, string $operator = '>=', int $count = 1)

Добавить условие подсчета/существования связи к запросу с "или".

Параметры

string $relation
string $operator
int $count

Возвращаемое значение

Builder|QueriesRelationships
END_OF_DOCUMENT_MARKER

Builder|QueriesRelationships doesntHave(string $relation, string $boolean = 'and', Closure $callback = null)

Добавить условие подсчёта/существования связи в запрос.

Параметры

string $relation
string $boolean
Closure $callback

Возвращаемое значение

Builder|QueriesRelationships

Builder|QueriesRelationships orDoesntHave(string $relation)

Добавить условие подсчёта/существования связи в запрос с "или".

Параметры

string $relation

Возвращаемое значение

Builder|QueriesRelationships

Builder|QueriesRelationships whereHas(string $relation, Closure $callback = null, string $operator = '>=', int $count = 1)

Добавить условие подсчёта/существования связи в запрос с условиями where.

Параметры

string $relation
Closure $callback
string $operator
int $count

Возвращаемое значение

Builder|QueriesRelationships

Builder|QueriesRelationships orWhereHas(string $relation, Closure $callback = null, string $operator = '>=', int $count = 1)

Добавить условие подсчёта/существования связи в запрос с условиями where и "или".

Параметры

string $relation
Closure $callback
string $operator
int $count

Возвращаемое значение

Builder|QueriesRelationships

Builder|QueriesRelationships whereDoesntHave(string $relation, Closure $callback = null)

Добавить условие подсчёта/существования связи в запрос с условиями where.

Параметры

string $relation
Closure $callback

Возвращаемое значение

Builder|QueriesRelationships

Builder|QueriesRelationships orWhereDoesntHave(string $relation, Closure $callback = null)

Добавить условие подсчёта/существования связи в запрос с условиями where и "или".

Параметры

string $relation
Closure $callback

Возвращаемое значение

Builder|QueriesRelationships

$this withCount(mixed $relations)

Добавить подзапросы для подсчёта связей.

Параметры

mixed $relations

Возвращаемое значение

$this

protected Builder|QueriesRelationships addHasWhere(Builder $hasQuery, Relation $relation, string $operator, int $count, string $boolean)

Добавить условие "has" к запросу.

Параметры

Builder $hasQuery
Relation $relation
string $operator
int $count
string $boolean

Возвращаемое значение

Builder|QueriesRelationships

Builder|QueriesRelationships mergeConstraintsFrom(Builder $from)

Объединить условия where из другого запроса в текущий запрос.

Параметры

Builder $from

Возвращаемое значение

Builder|QueriesRelationships

protected $this addWhereCountQuery(Builder $query, string $operator = '>=', int $count = 1, string $boolean = 'and')

Добавить условие подсчёта подзапроса к этому запросу.

Параметры

Builder $query
string $operator
int $count
string $boolean

Возвращаемое значение

$this

protected Relation getRelationWithoutConstraints(string $relation)

Получить экземпляр базового запроса "has relation".

Параметры

string $relation

Возвращаемое значение

Relation
END_OF_DOCUMENT_MARKER

protected bool canUseExistsForExistenceCheck(string $operator, int $count)

Проверка возможности выполнения запроса "exists" для оптимизации производительности.

Параметры

string $operator
int $count

Значение возврата

bool

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

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API