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.

orOn( Closure|string $first, string|null $operator = null, string|null $second = null)

Add an "or on" clause to the join.

where( Closure|string $first, string|null $operator = null, string|null $second = null, string $boolean = 'and')

Add an "on where" clause to the join.

orWhere( Closure|string $first, string|null $operator = null, string|null $second = null)

Add an "or on where" clause to the join.

whereNull( string $column, string $boolean = 'and')

Add an "on where is null" clause to the join.

orWhereNull( string $column)

Add an "or on where is null" clause to the join.

whereNotNull( string $column, string $boolean = 'and')

Add an "on where is not null" clause to the join.

orWhereNotNull( string $column)

Add an "or on where is not null" clause to the join.

whereIn( string $column, array $values)

Add an "on where in (.

whereNotIn( string $column, array $values)

Add an "on where not in (.

orWhereIn( string $column, array $values)

Add an "or on where in (.

orWhereNotIn( string $column, array $values)

Add an "or on where not in (.

nest( Closure $callback, string $boolean = 'and')

Add a nested where statement to the query.

Details

at line line 45
void __construct( string $type, string $table)

Create a new join clause instance.

Parameters

string $type
string $table

Return Value

void

at line line 72
$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.userid', '=', 'users.id') ->on('contacts.infoid', '=', 'info.id')

will produce the following SQL:

on contacts.user_id = users.id and contacts.info_id = info.id

Parameters

Closure|string $first
string|null $operator
string|null $second
string $boolean
bool $where

Return Value

$this

Exceptions

InvalidArgumentException

at line line 105
JoinClause orOn( Closure|string $first, string|null $operator = null, string|null $second = null)

Add an "or on" clause to the join.

Parameters

Closure|string $first
string|null $operator
string|null $second

Return Value

JoinClause

at line line 119
JoinClause where( Closure|string $first, string|null $operator = null, string|null $second = null, string $boolean = 'and')

Add an "on where" clause to the join.

Parameters

Closure|string $first
string|null $operator
string|null $second
string $boolean

Return Value

JoinClause

at line line 132
JoinClause orWhere( Closure|string $first, string|null $operator = null, string|null $second = null)

Add an "or on where" clause to the join.

Parameters

Closure|string $first
string|null $operator
string|null $second

Return Value

JoinClause

at line line 144
JoinClause whereNull( string $column, string $boolean = 'and')

Add an "on where is null" clause to the join.

Parameters

string $column
string $boolean

Return Value

JoinClause

at line line 155
JoinClause orWhereNull( string $column)

Add an "or on where is null" clause to the join.

Parameters

string $column

Return Value

JoinClause

at line line 167
JoinClause whereNotNull( string $column, string $boolean = 'and')

Add an "on where is not null" clause to the join.

Parameters

string $column
string $boolean

Return Value

JoinClause

at line line 178
JoinClause orWhereNotNull( string $column)

Add an "or on where is not null" clause to the join.

Parameters

string $column

Return Value

JoinClause

at line line 190
JoinClause whereIn( string $column, array $values)

Add an "on where in (.

..)" clause to the join.

Parameters

string $column
array $values

Return Value

JoinClause

at line line 202
JoinClause whereNotIn( string $column, array $values)

Add an "on where not in (.

..)" clause to the join.

Parameters

string $column
array $values

Return Value

JoinClause

at line line 214
JoinClause orWhereIn( string $column, array $values)

Add an "or on where in (.

..)" clause to the join.

Parameters

string $column
array $values

Return Value

JoinClause

at line line 226
JoinClause orWhereNotIn( string $column, array $values)

Add an "or on where not in (.

..)" clause to the join.

Parameters

string $column
array $values

Return Value

JoinClause

at line line 238
JoinClause nest( Closure $callback, string $boolean = 'and')

Add a nested where statement to the query.

Parameters

Closure $callback
string $boolean

Return Value

JoinClause