Properties

$columns

$columns : array

The columns that should be returned.

Type

array

$aggregate

$aggregate : array

An aggregate function and column to be run.

Type

array

$distinct

$distinct : boolean

Indicates if the query returns distinct results.

Type

boolean

$from

$from : string

The table which the query is targeting.

Type

string

$wheres

$wheres : array

The where constraints for the query.

Type

array

$orders

$orders : array

The orderings for the query.

Type

array

$limit

$limit : integer

The maximum number of records to return.

Type

integer

$operators

$operators : array

All of the available clause operators.

Type

array

Methods

select()

select(array|mixed  $columns = array('*')) : $this

Set the columns to be selected.

Parameters

array|mixed $columns

Returns

$this

selectRaw()

selectRaw(\app\framework\Component\Database\Query\string  $query, array  $bindings = array()) 

Parameters

\app\framework\Component\Database\Query\string $query
array $bindings

insert()

insert(array  $values) 

Parameters

array $values

insertRaw()

insertRaw(\app\framework\Component\Database\Query\string  $query, array  $bindings = array()) 

Parameters

\app\framework\Component\Database\Query\string $query
array $bindings

updateRaw()

updateRaw(\app\framework\Component\Database\Query\string  $query, array  $bindings = array()) 

Parameters

\app\framework\Component\Database\Query\string $query
array $bindings

deleteRaw()

deleteRaw(\app\framework\Component\Database\Query\string  $query, array  $bindings = array()) 

Parameters

\app\framework\Component\Database\Query\string $query
array $bindings

from()

from(string  $table) : $this

Set the table which the query is targeting.

Parameters

string $table

Returns

$this

where()

where(string|array  $column, string  $operator = "=", mixed  $value = null, string  $bool = 'and') : $this

Add a basic where clause to the query.

Parameters

string|array $column
string $operator
mixed $value
string $bool

Returns

$this

orderBy()

orderBy(array|string  $column, string  $direction = 'asc') : $this

Add an "order by" clause to the query.

Parameters

array|string $column
string $direction

asc or desc

Returns

$this

get()

get() : array|null

Execute the query as a "select" statement.

Returns

array|null

cleanBindings()

cleanBindings(array  $bindings) : array

Remove all of the expressions from a list of bindings.

Parameters

array $bindings

Returns

array

prepareRawQuery()

prepareRawQuery(string  $query, array  $bindings) : string

Switch values in query with value fitting in binding

Parameters

string $query

The query to prepare

array $bindings

Array of the bindings

Returns

string —

The run ready query

isOperatorValid()

isOperatorValid(  $operatorToCheck) : boolean

Check if the operator is in the list of valid operators.

Returns true if it is.

Parameters

$operatorToCheck

Returns

boolean

toSql()

toSql() : string

Get the SQL representation of the query.

Returns

string