Join
Trait Join.
Tags
Table of Contents
Methods
- 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
staticcrossJoinOn()
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
staticcrossJoinUsing()
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
staticfrom()
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
staticinnerJoinOn()
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
staticinnerJoinUsing()
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
staticjoin()
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 OUTERor empty (same asINNER) - $clause : string|null = null
-
Condition clause. Null if it has a NATURAL type, otherwise
ONorUSING - $conditional : Closure|array<int, Closure|string>|null = null
-
A conditional expression as Closure or the columns list as array
Return values
staticjoinOn()
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
staticjoinUsing()
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
staticleftJoinOn()
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
staticleftJoinUsing()
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
staticleftOuterJoinOn()
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
staticleftOuterJoinUsing()
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
staticnaturalJoin()
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
staticnaturalLeftJoin()
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
staticnaturalLeftOuterJoin()
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
staticnaturalRightJoin()
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
staticnaturalRightOuterJoin()
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
staticrightJoinOn()
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
staticrightJoinUsing()
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
staticrightOuterJoinOn()
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
staticrightOuterJoinUsing()
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
statichasFrom()
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