Builder
in package
Leaf Db Query Builder ------------------------- Functionality of leaf query builder.
Tags
Table of Contents
Properties
- $bindings : mixed
- Params bound to query
Methods
- groupBy() : string
- Group query results by a column
- limit() : string
- Limit query to specific number of values to return
- offset() : string
- Offset query items by a specific number
- orderBy() : string
- Order query results by a column
- params() : string
- Builder for params block
- where() : string
- Controls inner workings of all where blocks
Properties
$bindings
Params bound to query
public
static mixed
$bindings
= []
Methods
groupBy()
Group query results by a column
public
static groupBy(string $query, string $column) : string
Parameters
- $query : string
-
The query to modify (if any)
- $column : string
-
The column to group results by
Tags
Return values
stringlimit()
Limit query to specific number of values to return
public
static limit(string $query, string|number $number) : string
Parameters
- $query : string
-
The query to modify (if any)
- $number : string|number
-
Limit to query
Return values
stringoffset()
Offset query items by a specific number
public
static offset(string $query, string|number $number) : string
Parameters
- $query : string
-
The query to modify (if any)
- $number : string|number
-
Offset to query
Return values
stringorderBy()
Order query results by a column
public
static orderBy(string $query, string $column[, string $direction = 'desc' ]) : string
Parameters
- $query : string
-
The query to modify (if any)
- $column : string
-
The column to order results by
- $direction : string = 'desc'
-
The direction to order [DESC, ASC]
Return values
stringparams()
Builder for params block
public
static params(string $query, array<string|int, mixed>|string $params) : string
Parameters
- $query : string
-
The query to modify
- $params : array<string|int, mixed>|string
-
Key or params to pass into query
Return values
stringwhere()
Controls inner workings of all where blocks
public
static where(string $query, string|array<string|int, mixed> $condition[, mixed $value = null ][, string $comparator = '=' ][, string $operation = 'AND' ]) : string
Parameters
- $query : string
-
The query to modify
- $condition : string|array<string|int, mixed>
-
The condition to evaluate
- $value : mixed = null
-
The value if condition is a string
- $comparator : string = '='
-
The comparator to bind condition
- $operation : string = 'AND'
-
The operation to join multiple wheres