Leaf PHP

Builder
in package

Leaf Db Query Builder ------------------------- Functionality of leaf query builder.

Tags
author

Michael Darko

since
3.0
version
1.0.0

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
author

Milos Lukic https://github.com/iammiloslukic

Return values
string

limit()

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
string

offset()

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
string

orderBy()

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
string

params()

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
string

where()

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

Return values
string

        
On this page

Search results