JoinClause
class JoinClause (View source)
Properties
string | $type | The type of join being performed. | |
string | $table | The table the join clause is joining to. | |
array | $clauses | The "on" clauses for the join. | |
array | $bindings | The "on" bindings for the join. |
Methods
void | __construct(string $type, string $table) Create a new join clause instance. | |
$this | on(Closure|string $first, string|null $operator = null, string|null $second = null, string $boolean = 'and', bool $where = false) Add an "on" clause to the join. | |
JoinClause | orOn(Closure|string $first, string|null $operator = null, string|null $second = null) Add an "or on" clause to the join. | |
JoinClause | where(Closure|string $first, string|null $operator = null, string|null $second = null, string $boolean = 'and') Add an "on where" clause to the join. | |
JoinClause | orWhere(Closure|string $first, string|null $operator = null, string|null $second = null) Add an "or on where" clause to the join. | |
JoinClause | whereNull(string $column, string $boolean = 'and') Add an "on where is null" clause to the join. | |
JoinClause | orWhereNull(string $column) Add an "or on where is null" clause to the join. | |
JoinClause | whereNotNull(string $column, string $boolean = 'and') Add an "on where is not null" clause to the join. | |
JoinClause | orWhereNotNull(string $column) Add an "or on where is not null" clause to the join. | |
JoinClause | whereIn(string $column, array $values) Add an "on where in (. | |
JoinClause | whereNotIn(string $column, array $values) Add an "on where not in (. | |
JoinClause | orWhereIn(string $column, array $values) Add an "or on where in (. | |
JoinClause | orWhereNotIn(string $column, array $values) Add an "or on where not in (. | |
JoinClause | nest(Closure $callback, string $boolean = 'and') Add a nested where statement to the query. |
Details
void __construct(string $type, string $table)
Create a new join clause instance.
$this on(Closure|string $first, string|null $operator = null, string|null $second = null, string $boolean = 'and', bool $where = false)
Add an "on" clause to the join.
On clauses can be chained, e.g.
$join->on('contacts.user_id', '=', 'users.id') ->on('contacts.info_id', '=', 'info.id')
will produce the following SQL:
on contacts
.user_id
= users
.id
and contacts
.info_id
= info
.id
JoinClause orOn(Closure|string $first, string|null $operator = null, string|null $second = null)
Add an "or on" clause to the join.
JoinClause where(Closure|string $first, string|null $operator = null, string|null $second = null, string $boolean = 'and')
Add an "on where" clause to the join.
JoinClause orWhere(Closure|string $first, string|null $operator = null, string|null $second = null)
Add an "or on where" clause to the join.
JoinClause whereNull(string $column, string $boolean = 'and')
Add an "on where is null" clause to the join.
JoinClause orWhereNull(string $column)
Add an "or on where is null" clause to the join.
JoinClause whereNotNull(string $column, string $boolean = 'and')
Add an "on where is not null" clause to the join.
JoinClause orWhereNotNull(string $column)
Add an "or on where is not null" clause to the join.
JoinClause whereIn(string $column, array $values)
Add an "on where in (.
..)" clause to the join.
JoinClause whereNotIn(string $column, array $values)
Add an "on where not in (.
..)" clause to the join.
JoinClause orWhereIn(string $column, array $values)
Add an "or on where in (.
..)" clause to the join.
JoinClause orWhereNotIn(string $column, array $values)
Add an "or on where not in (.
..)" clause to the join.
JoinClause nest(Closure $callback, string $boolean = 'and')
Add a nested where statement to the query.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.1/Illuminate/Database/Query/JoinClause.html