Join
Trait Join.
Tags
Table of Contents
- crossJoin() : static
- Adds a JOIN clause with "CROSS JOIN $table".
- crossJoinOn() : static
- Adds a JOIN clause with "CROSS JOIN $table ON $conditional".
- crossJoinUsing() : static
- Adds a JOIN clause with "CROSS JOIN $table USING ...$columns".
- from() : static
- Sets the FROM clause.
- innerJoinOn() : static
- Adds a JOIN clause with "INNER JOIN $table ON $conditional".
- innerJoinUsing() : static
- Adds a JOIN clause with "INNER JOIN $table USING ...$columns".
- join() : static
- Adds a JOIN clause with "$type JOIN $table $clause $conditional".
- joinOn() : static
- Adds a JOIN clause with "JOIN $table ON $conditional".
- joinUsing() : static
- Adds a JOIN clause with "JOIN $table USING ...$columns".
- leftJoinOn() : static
- Adds a JOIN clause with "LEFT JOIN $table ON $conditional".
- leftJoinUsing() : static
- Adds a JOIN clause with "LEFT JOIN $table USING ...$columns".
- leftOuterJoinOn() : static
- Adds a JOIN clause with "LEFT OUTER JOIN $table ON $conditional".
- leftOuterJoinUsing() : static
- Adds a JOIN clause with "LEFT OUTER JOIN $table USING ...$columns".
- naturalJoin() : static
- Adds a JOIN clause with "NATURAL JOIN $table".
- naturalLeftJoin() : static
- Adds a JOIN clause with "NATURAL LEFT JOIN $table".
- naturalLeftOuterJoin() : static
- Adds a JOIN clause with "NATURAL LEFT OUTER JOIN $table".
- naturalRightJoin() : static
- Adds a JOIN clause with "NATURAL RIGHT JOIN $table".
- naturalRightOuterJoin() : static
- Adds a JOIN clause with "NATURAL RIGHT OUTER JOIN $table".
- rightJoinOn() : static
- Adds a JOIN clause with "RIGHT JOIN $table ON $conditional".
- rightJoinUsing() : static
- Adds a JOIN clause with "RIGHT JOIN $table USING ...$columns".
- rightOuterJoinOn() : static
- Adds a JOIN clause with "RIGHT OUTER JOIN $table ON $conditional".
- rightOuterJoinUsing() : static
- Adds a JOIN clause with "RIGHT OUTER JOIN $table USING ...$columns".
- hasFrom() : bool
- Tells if the FROM clause was set.
- renderFrom() : string|null
- Renders the FROM clause.
- renderJoin() : string|null
- Renders the JOIN clause.
Methods
crossJoin()
Adds a JOIN clause with "CROSS JOIN $table".
public
crossJoin(Closure|array<string, \Closure|string>|string $table) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
Return values
static —crossJoinOn()
Adds a JOIN clause with "CROSS JOIN $table ON $conditional".
public
crossJoinOn(Closure|array<string, \Closure|string>|string $table, Closure $conditional) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
- $conditional : Closure
-
Conditional expression
Return values
static —crossJoinUsing()
Adds a JOIN clause with "CROSS JOIN $table USING ...$columns".
public
crossJoinUsing(Closure|array<string, \Closure|string>|string $table, Closure|string ...$columns) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
- $columns : Closure|string
-
Columns list
Return values
static —from()
Sets the FROM clause.
public
from(Closure|array<string, \Closure|string>|string $reference, Closure|array<string, \Closure|string>|string ...$references) : static
Parameters
- $reference : Closure|array<string, \Closure|string>|string
-
Table reference
- $references : Closure|array<string, \Closure|string>|string
-
Table references
Tags
Return values
static —innerJoinOn()
Adds a JOIN clause with "INNER JOIN $table ON $conditional".
public
innerJoinOn(Closure|array<string, \Closure|string>|string $table, Closure $conditional) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
- $conditional : Closure
-
Conditional expression
Return values
static —innerJoinUsing()
Adds a JOIN clause with "INNER JOIN $table USING ...$columns".
public
innerJoinUsing(Closure|array<string, \Closure|string>|string $table, Closure|string ...$columns) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
- $columns : Closure|string
-
Columns list
Return values
static —join()
Adds a JOIN clause with "$type JOIN $table $clause $conditional".
public
join(Closure|array<string, \Closure|string>|string $table[, string $type = '' ][, string|null $clause = null ][, Closure|array<int, \Closure|string>|null $conditional = null ]) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
- $type : string = ''
-
JOIN type. One of:
CROSS
,INNER
,LEFT
,LEFT OUTER
,RIGHT
,RIGHT OUTER
,NATURAL
,NATURAL LEFT
,NATURAL LEFT OUTER
,NATURAL RIGHT
,NATURAL RIGHT OUTER
or empty (same asINNER
) - $clause : string|null = null
-
Condition clause. Null if it has a NATURAL type, otherwise
ON
orUSING
- $conditional : Closure|array<int, \Closure|string>|null = null
-
A conditional expression as Closure or the columns list as array
Return values
static —joinOn()
Adds a JOIN clause with "JOIN $table ON $conditional".
public
joinOn(Closure|array<string, \Closure|string>|string $table, Closure $conditional) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
- $conditional : Closure
-
Conditional expression
Return values
static —joinUsing()
Adds a JOIN clause with "JOIN $table USING ...$columns".
public
joinUsing(Closure|array<string, \Closure|string>|string $table, Closure|string ...$columns) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
- $columns : Closure|string
-
Columns list
Return values
static —leftJoinOn()
Adds a JOIN clause with "LEFT JOIN $table ON $conditional".
public
leftJoinOn(Closure|array<string, \Closure|string>|string $table, Closure $conditional) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
- $conditional : Closure
-
Conditional expression
Return values
static —leftJoinUsing()
Adds a JOIN clause with "LEFT JOIN $table USING ...$columns".
public
leftJoinUsing(Closure|array<string, \Closure|string>|string $table, Closure|string ...$columns) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
- $columns : Closure|string
-
Columns list
Return values
static —leftOuterJoinOn()
Adds a JOIN clause with "LEFT OUTER JOIN $table ON $conditional".
public
leftOuterJoinOn(Closure|array<string, \Closure|string>|string $table, Closure $conditional) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
- $conditional : Closure
-
Conditional expression
Return values
static —leftOuterJoinUsing()
Adds a JOIN clause with "LEFT OUTER JOIN $table USING ...$columns".
public
leftOuterJoinUsing(Closure|array<string, \Closure|string>|string $table, Closure|string ...$columns) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
- $columns : Closure|string
-
Columns list
Return values
static —naturalJoin()
Adds a JOIN clause with "NATURAL JOIN $table".
public
naturalJoin(Closure|array<string, \Closure|string>|string $table) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
Return values
static —naturalLeftJoin()
Adds a JOIN clause with "NATURAL LEFT JOIN $table".
public
naturalLeftJoin(Closure|array<string, \Closure|string>|string $table) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
Return values
static —naturalLeftOuterJoin()
Adds a JOIN clause with "NATURAL LEFT OUTER JOIN $table".
public
naturalLeftOuterJoin(Closure|array<string, \Closure|string>|string $table) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
Return values
static —naturalRightJoin()
Adds a JOIN clause with "NATURAL RIGHT JOIN $table".
public
naturalRightJoin(Closure|array<string, \Closure|string>|string $table) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
Return values
static —naturalRightOuterJoin()
Adds a JOIN clause with "NATURAL RIGHT OUTER JOIN $table".
public
naturalRightOuterJoin(Closure|array<string, \Closure|string>|string $table) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
Return values
static —rightJoinOn()
Adds a JOIN clause with "RIGHT JOIN $table ON $conditional".
public
rightJoinOn(Closure|array<string, \Closure|string>|string $table, Closure $conditional) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
- $conditional : Closure
-
Conditional expression
Return values
static —rightJoinUsing()
Adds a JOIN clause with "RIGHT JOIN $table USING ...$columns".
public
rightJoinUsing(Closure|array<string, \Closure|string>|string $table, Closure|string ...$columns) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
- $columns : Closure|string
-
Columns list
Return values
static —rightOuterJoinOn()
Adds a JOIN clause with "RIGHT OUTER JOIN $table ON $conditional".
public
rightOuterJoinOn(Closure|array<string, \Closure|string>|string $table, Closure $conditional) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
- $conditional : Closure
-
Conditional expression
Return values
static —rightOuterJoinUsing()
Adds a JOIN clause with "RIGHT OUTER JOIN $table USING ...$columns".
public
rightOuterJoinUsing(Closure|array<string, \Closure|string>|string $table, Closure|string ...$columns) : static
Parameters
- $table : Closure|array<string, \Closure|string>|string
-
Table factor
- $columns : Closure|string
-
Columns list
Return values
static —hasFrom()
Tells if the FROM clause was set.
protected
hasFrom([string|null $clause = null ]) : bool
Parameters
- $clause : string|null = null
-
A clause where FROM is required
Tags
Return values
bool —True if it has FROM, otherwise false
renderFrom()
Renders the FROM clause.
protected
renderFrom() : string|null
Return values
string|null —The FROM clause or null if it was not set
renderJoin()
Renders the JOIN clause.
protected
renderJoin() : string|null
Return values
string|null —The JOIN clause or null if it was not set