Builder
extends ContractBuilder
in package
Uses
AggregateTrait, ParseTrait, FilterTrait
Table of Contents
Properties
- $columns : mixed|string
- $database : Piql
- $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
- avg() : string|null
- build() : mixed
- builder() : static
- count() : int|null
- delete() : PDOStatement|null
- first() : object|null
- Same as get() but returns the first item of the resultset
- get() : object|null
- Returns one item from the CDatabase
- group() : mixed
- having() : $this
- Adds a 'having' clause to the query
- limit() : static
- match() : static
- max() : string|null
- min() : string|null
- orderBy() : $this
- Orders the query by certain value.
- startAt() : static
- sum() : string|null
- where() : static
- runGet() : mixed
- runSelect() : array<string|int, mixed>|null
Properties
$columns
private
mixed|string
$columns
= "*"
$database
private
Piql
$database
$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>|nullavg()
public
avg(string $column, array<string|int, mixed>|null $where) : string|null
Parameters
- $column : string
- $where : array<string|int, mixed>|null
Tags
Return values
string|nullbuild()
public
build() : mixed
builder()
public
static builder(mixed ...$args) : static
Parameters
- $args : mixed
Return values
staticcount()
public
count([string|null $column = null ][, array<string|int, mixed>|null $where = null ]) : int|null
Parameters
- $column : string|null = null
- $where : array<string|int, mixed>|null = null
Tags
Return values
int|nulldelete()
public
delete(int|array<string|int, mixed>|string $where[, string|null $idField = 'id' ]) : PDOStatement|null
Parameters
- $where : int|array<string|int, mixed>|string
- $idField : string|null = 'id'
Tags
Return values
PDOStatement|nullfirst()
Same as get() but returns the first item of the resultset
public
first() : object|null
Return values
object|nullget()
Returns one item from the CDatabase
public
get([array<string|int, mixed>|int|null $where = null ]) : object|null
Parameters
- $where : array<string|int, mixed>|int|null = null
Tags
Return values
object|nullgroup()
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
$thislimit()
public
limit(int $limit) : static
Parameters
- $limit : int
Tags
Return values
staticmatch()
public
match(mixed $columns, mixed $keyword[, mixed $mode = 'natural' ]) : static
Parameters
- $columns : mixed
- $keyword : mixed
- $mode : mixed = 'natural'
Return values
staticmax()
public
max(string $column, array<string|int, mixed>|null $where) : string|null
Parameters
- $column : string
- $where : array<string|int, mixed>|null
Tags
Return values
string|nullmin()
public
min(string $column, array<string|int, mixed>|null $where) : string|null
Parameters
- $column : string
- $where : array<string|int, mixed>|null
Tags
Return values
string|nullorderBy()
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
$thisstartAt()
public
startAt([int $startPoint = 0 ]) : static
Parameters
- $startPoint : int = 0
Return values
staticsum()
public
sum(string $column, array<string|int, mixed>|null $where) : string|null
Parameters
- $column : string
- $where : array<string|int, mixed>|null
Tags
Return values
string|nullwhere()
public
where(array<string|int, mixed> $where) : static
Parameters
- $where : array<string|int, mixed>
Return values
staticrunGet()
private
runGet() : mixed
runSelect()
private
runSelect(callable|null $callback) : array<string|int, mixed>|null
Parameters
- $callback : callable|null