Join
extends ContractBuilder
in package
Uses
JoinParseTrait, FilterTrait
Builds relationships across multiple tables.
Table of Contents
Properties
- $columns : mixed|string
- $database : Piql
- $joins : array<string|int, mixed>
- List of all joins that are about to be applied.These are in a medoo format.
- $preventLimit : bool
- $table : string
- $where : array<string|int, mixed>
Methods
- __construct() : mixed
- all() : array<string|int, mixed>|null
- Returns all items from the CDatabase. If a callback is passed, it will be called on each item in the resultset
- build() : Join
- builder() : static
- count() : int|null
- full() : static
- getJoins() : array<string|int, mixed>
- Returns the medoo-like join array that was generated after chaining multiple joins
- group() : mixed
- having() : $this
- Adds a 'having' clause to the query
- inner() : static
- left() : static
- limit() : static
- orderBy() : $this
- Orders the query by certain value.
- right() : static
- startAt() : static
- where() : static
- join() : static
- runSelect() : array<string|int, mixed>|null
Properties
$columns
private
mixed|string
$columns
$database
private
Piql
$database
$joins
List of all joins that are about to be applied.These are in a medoo format.
private
array<string|int, mixed>
$joins
= []
$preventLimit
private
bool
$preventLimit
= false
$table
private
string
$table
$where
private
array<string|int, mixed>
$where
Methods
__construct()
public
__construct(mixed $table, Piql $database[, mixed $columns = "*" ][, mixed $where = [] ]) : mixed
Parameters
- $table : mixed
- $database : Piql
- $columns : mixed = "*"
- $where : mixed = []
all()
Returns all items from the CDatabase. If a callback is passed, it will be called on each item in the resultset
public
all([callable|null $callback = null ]) : array<string|int, mixed>|null
Parameters
- $callback : callable|null = null
-
This is the receiver for the current resultset
Tags
Return values
array<string|int, mixed>|nullbuild()
public
build() : Join
Return values
Joinbuilder()
public
static builder(mixed ...$args) : static
Parameters
- $args : mixed
Return values
staticcount()
public
count([string|null $column = "*" ][, array<string|int, mixed>|null $where = null ]) : int|null
Parameters
- $column : string|null = "*"
- $where : array<string|int, mixed>|null = null
Tags
Return values
int|nullfull()
public
full(mixed $table, string|array<string|int, mixed> $on_or_using[, string|null $alias = null ]) : static
Parameters
- $table : mixed
- $on_or_using : string|array<string|int, mixed>
- $alias : string|null = null
Return values
staticgetJoins()
Returns the medoo-like join array that was generated after chaining multiple joins
public
getJoins() : array<string|int, mixed>
Return values
array<string|int, mixed>group()
public
group(string|array<string|int, mixed> $group) : mixed
Parameters
- $group : string|array<string|int, mixed>
having()
Adds a 'having' clause to the query
public
having(string $column, mixed $value[, string|null $needle = null ]) : $this
Parameters
- $column : string
- $value : mixed
- $needle : string|null = null
-
can be >, <, !,>=, <=. >< and <> are available for datetime
Return values
$thisinner()
public
inner(mixed $table, string|array<string|int, mixed> $on_or_using[, string|null $alias = null ]) : static
Parameters
- $table : mixed
- $on_or_using : string|array<string|int, mixed>
- $alias : string|null = null
Return values
staticleft()
public
left(mixed $table, string|array<string|int, mixed> $on_or_using[, string|null $alias = null ]) : static
Parameters
- $table : mixed
- $on_or_using : string|array<string|int, mixed>
- $alias : string|null = null
Return values
staticlimit()
public
limit(int $limit) : static
Parameters
- $limit : int
Tags
Return values
staticorderBy()
Orders the query by certain value.
public
orderBy(string|array<string|int, mixed> $value) : $this
Parameters
- $value : string|array<string|int, mixed>
Tags
Return values
$thisright()
public
right(mixed $table, string|array<string|int, mixed> $on_or_using[, string|null $alias = null ]) : static
Parameters
- $table : mixed
- $on_or_using : string|array<string|int, mixed>
- $alias : string|null = null
Return values
staticstartAt()
public
startAt([int $startPoint = 0 ]) : static
Parameters
- $startPoint : int = 0
Return values
staticwhere()
public
where(array<string|int, mixed> $where) : static
Parameters
- $where : array<string|int, mixed>
Return values
staticjoin()
private
join(string $joinTable, string $alias, string|array<string|int, mixed> $on_or_using, string $joinType) : static
Parameters
- $joinTable : string
- $alias : string
- $on_or_using : string|array<string|int, mixed>
- $joinType : string
Return values
staticrunSelect()
private
runSelect(callable|null $callback) : array<string|int, mixed>|null
Parameters
- $callback : callable|null