Aplus Framework Docs

Update extends Statement
in package
uses Explain, Join, Set, Where, OrderBy

Class Update.

Tags
see
https://mariadb.com/kb/en/update/

Table of Contents

Constants

EXP_EXTENDED  : string = 'EXTENDED'
EXP_FORMAT_JSON  : string = 'FORMAT=JSON'
EXP_PARTITIONS  : string = 'PARTITIONS'
https://mariadb.com/kb/en/partition-pruning-and-selection/.
OPT_IGNORE  : string = 'IGNORE'
Convert errors to warnings, which will not stop inserts of additional rows.
OPT_LOW_PRIORITY  : string = 'LOW_PRIORITY'

Properties

$database  : Database
$sql  : array<string, mixed>
SQL clauses and parts.

Methods

__construct()  : mixed
Statement constructor.
__toString()  : string
crossJoin()  : static
Adds a JOIN clause with "CROSS JOIN $table".
crossJoinOn()  : static
Adds a JOIN clause with "CROSS JOIN $table ON $conditional".
crossJoinUsing()  : static
Adds a JOIN clause with "CROSS JOIN $table USING ...$columns".
explain()  : array<int, Explain>
EXPLAIN provides information about statements.
from()  : static
Sets the FROM clause.
innerJoinOn()  : static
Adds a JOIN clause with "INNER JOIN $table ON $conditional".
innerJoinUsing()  : static
Adds a JOIN clause with "INNER JOIN $table USING ...$columns".
join()  : static
Adds a JOIN clause with "$type JOIN $table $clause $conditional".
joinOn()  : static
Adds a JOIN clause with "JOIN $table ON $conditional".
joinUsing()  : static
Adds a JOIN clause with "JOIN $table USING ...$columns".
leftJoinOn()  : static
Adds a JOIN clause with "LEFT JOIN $table ON $conditional".
leftJoinUsing()  : static
Adds a JOIN clause with "LEFT JOIN $table USING ...$columns".
leftOuterJoinOn()  : static
Adds a JOIN clause with "LEFT OUTER JOIN $table ON $conditional".
leftOuterJoinUsing()  : static
Adds a JOIN clause with "LEFT OUTER JOIN $table USING ...$columns".
limit()  : static
Sets the LIMIT clause.
naturalJoin()  : static
Adds a JOIN clause with "NATURAL JOIN $table".
naturalLeftJoin()  : static
Adds a JOIN clause with "NATURAL LEFT JOIN $table".
naturalLeftOuterJoin()  : static
Adds a JOIN clause with "NATURAL LEFT OUTER JOIN $table".
naturalRightJoin()  : static
Adds a JOIN clause with "NATURAL RIGHT JOIN $table".
naturalRightOuterJoin()  : static
Adds a JOIN clause with "NATURAL RIGHT OUTER JOIN $table".
options()  : static
Sets the statement options.
orderBy()  : static
Appends columns to the ORDER BY clause.
orderByAsc()  : static
Appends columns with the ASC direction to the ORDER BY clause.
orderByDesc()  : static
Appends columns with the DESC direction to the ORDER BY clause.
orWhere()  : static
Appends a "OR $column $operator ...$values" condition in the WHERE clause.
orWhereBetween()  : static
Appends a "OR $column BETWEEN $min AND $max" condition in the WHERE clause.
orWhereEqual()  : static
Appends a "OR $column = $value" condition in the WHERE clause.
orWhereGreaterThan()  : static
Appends a "OR $column > $value" condition in the WHERE clause.
orWhereGreaterThanOrEqual()  : static
Appends a "OR $column >= $value" condition in the WHERE clause.
orWhereIn()  : static
Appends a "OR $column IN (...$values)" condition in the WHERE clause.
orWhereIsNotNull()  : static
Appends a "OR $column IS NOT NULL" condition in the WHERE clause.
orWhereIsNull()  : static
Appends a "OR $column IS NULL" condition in the WHERE clause.
orWhereLessThan()  : static
Appends a "OR $column < $value" condition in the WHERE clause.
orWhereLessThanOrEqual()  : static
Appends a "OR $column <= $value" condition in the WHERE clause.
orWhereLike()  : static
Appends a "OR $column LIKE $value" condition in the WHERE clause.
orWhereMatch()  : static
Appends a "OR MATCH (...$columns) AGAINST ($against IN NATURAL LANGUAGE MODE)" fulltext searching in the WHERE clause.
orWhereMatchInBooleanMode()  : static
Appends a "OR MATCH (...$columns) AGAINST ($against IN BOOLEAN MODE)" fulltext searching in the WHERE clause.
orWhereMatchWithQueryExpansion()  : static
Appends a "OR MATCH (...$columns) AGAINST ($against WITH QUERY EXPANSION)" fulltext searching in the WHERE clause.
orWhereNotBetween()  : static
Appends a "OR $column NOT BETWEEN $min AND $max" condition in the WHERE clause.
orWhereNotEqual()  : static
Appends a "OR $column != $value" condition in the WHERE clause.
orWhereNotIn()  : static
Appends a "OR $column NOT IN (...$values)" condition in the WHERE clause.
orWhereNotLike()  : static
Appends a "OR $column NOT LIKE $value" condition in the WHERE clause.
orWhereNullSafeEqual()  : static
Appends a "OR $column <=> $value" condition in the WHERE clause.
reset()  : static
Resets SQL clauses and parts.
rightJoinOn()  : static
Adds a JOIN clause with "RIGHT JOIN $table ON $conditional".
rightJoinUsing()  : static
Adds a JOIN clause with "RIGHT JOIN $table USING ...$columns".
rightOuterJoinOn()  : static
Adds a JOIN clause with "RIGHT OUTER JOIN $table ON $conditional".
rightOuterJoinUsing()  : static
Adds a JOIN clause with "RIGHT OUTER JOIN $table USING ...$columns".
run()  : int|string
Runs the UPDATE statement.
set()  : static
Sets the SET clause.
sql()  : string
Renders the UPDATE statement.
table()  : static
Sets the table references.
where()  : static
Appends an "AND $column $operator ...$values" condition in the WHERE clause.
whereBetween()  : static
Appends an "AND $column BETWEEN $min AND $max" condition in the WHERE clause.
whereEqual()  : static
Appends an "AND $column = $value" condition in the WHERE clause.
whereGreaterThan()  : static
Appends an "AND $column > $value" condition in the WHERE clause.
whereGreaterThanOrEqual()  : static
Appends an "AND $column >= $value" condition in the WHERE clause.
whereIn()  : static
Appends an "AND $column IN (...$values)" condition in the WHERE clause.
whereIsNotNull()  : static
Appends an "AND $column IS NOT NULL" condition in the WHERE clause.
whereIsNull()  : static
Appends an "AND $column IS NULL" condition in the WHERE clause.
whereLessThan()  : static
Appends an "AND $column < $value" condition in the WHERE clause.
whereLessThanOrEqual()  : static
Appends an "AND $column <= $value" condition in the WHERE clause.
whereLike()  : static
Appends an "AND $column LIKE $value" condition in the WHERE clause.
whereMatch()  : static
Appends an "AND MATCH (...$columns) AGAINST ($against IN NATURAL LANGUAGE MODE)" fulltext searching in the WHERE clause.
whereMatchInBooleanMode()  : static
Appends an "AND MATCH (...$columns) AGAINST ($against IN BOOLEAN MODE)" fulltext searching in the WHERE clause.
whereMatchWithQueryExpansion()  : static
Appends an "AND MATCH (...$columns) AGAINST ($against WITH QUERY EXPANSION)" fulltext searching in the WHERE clause.
whereNotBetween()  : static
Appends an "AND $column NOT BETWEEN $min AND $max" condition in the WHERE clause.
whereNotEqual()  : static
Appends an "AND $column != $value" condition in the WHERE clause.
whereNotIn()  : static
Appends an "AND $column NOT IN (...$values)" condition in the WHERE clause.
whereNotLike()  : static
Appends an "AND $column NOT LIKE $value" condition.
whereNullSafeEqual()  : static
Appends an "AND $column <=> $value" condition in the WHERE clause.
hasFrom()  : bool
Tells if the FROM clause was set.
hasOptions()  : bool
Tells if the statement has options set.
hasSet()  : bool
Tells if the SET clause was set.
renderAliasedIdentifier()  : string
Renders a column part with an optional alias name, AS clause.
renderAssignment()  : string
Renders an assignment part.
renderFrom()  : string|null
Renders the FROM clause.
renderIdentifier()  : string
Renders a column part.
renderJoin()  : string|null
Renders the JOIN clause.
renderLimit()  : string|null
Renders the LIMIT clause.
renderOptions()  : string|null
renderOrderBy()  : string|null
Renders the ORDER BY clause.
renderSet()  : string|null
Renders the SET clause.
renderSetCheckingConflicts()  : string|null
Renders the SET clause checking conflicts.
renderSetPart()  : string
renderTable()  : string
renderValue()  : float|int|string
Renders a subquery or quote a value.
renderWhere()  : string|null
Renders the full WHERE (or HAVING) clause.
setLimit()  : static
Sets the LIMIT clause.
subquery()  : string
Returns an SQL part between parentheses.

Constants

EXP_PARTITIONS

https://mariadb.com/kb/en/partition-pruning-and-selection/.

public string EXP_PARTITIONS = 'PARTITIONS'

Properties

$sql

SQL clauses and parts.

protected array<string, mixed> $sql = []

Methods

__toString()

public __toString() : string
Return values
string

crossJoin()

Adds a JOIN clause with "CROSS JOIN $table".

public crossJoin(Closure|array<string, Closure|string>|string $table) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

Return values
static

crossJoinOn()

Adds a JOIN clause with "CROSS JOIN $table ON $conditional".

public crossJoinOn(Closure|array<string, Closure|string>|string $table, Closure $conditional) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

$conditional : Closure

Conditional expression

Return values
static

crossJoinUsing()

Adds a JOIN clause with "CROSS JOIN $table USING ...$columns".

public crossJoinUsing(Closure|array<string, Closure|string>|string $table, Closure|string ...$columns) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

$columns : Closure|string

Columns list

Return values
static

from()

Sets the FROM clause.

public from(Closure|array<string, Closure|string>|string $reference, Closure|array<string, Closure|string>|string ...$references) : static
Parameters
$reference : Closure|array<string, Closure|string>|string

Table reference

$references : Closure|array<string, Closure|string>|string

Table references

Tags
see
https://mariadb.com/kb/en/join-syntax/
Return values
static

innerJoinOn()

Adds a JOIN clause with "INNER JOIN $table ON $conditional".

public innerJoinOn(Closure|array<string, Closure|string>|string $table, Closure $conditional) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

$conditional : Closure

Conditional expression

Return values
static

innerJoinUsing()

Adds a JOIN clause with "INNER JOIN $table USING ...$columns".

public innerJoinUsing(Closure|array<string, Closure|string>|string $table, Closure|string ...$columns) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

$columns : Closure|string

Columns list

Return values
static

join()

Adds a JOIN clause with "$type JOIN $table $clause $conditional".

public join(Closure|array<string, Closure|string>|string $table[, string $type = '' ][, string|null $clause = null ][, Closure|array<int, Closure|string>|null $conditional = null ]) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

$type : string = ''

JOIN type. One of: CROSS, INNER, LEFT, LEFT OUTER, RIGHT, RIGHT OUTER, NATURAL, NATURAL LEFT, NATURAL LEFT OUTER, NATURAL RIGHT, NATURAL RIGHT OUTER or empty (same as INNER)

$clause : string|null = null

Condition clause. Null if it has a NATURAL type, otherwise ON or USING

$conditional : Closure|array<int, Closure|string>|null = null

A conditional expression as Closure or the columns list as array

Return values
static

joinOn()

Adds a JOIN clause with "JOIN $table ON $conditional".

public joinOn(Closure|array<string, Closure|string>|string $table, Closure $conditional) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

$conditional : Closure

Conditional expression

Return values
static

joinUsing()

Adds a JOIN clause with "JOIN $table USING ...$columns".

public joinUsing(Closure|array<string, Closure|string>|string $table, Closure|string ...$columns) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

$columns : Closure|string

Columns list

Return values
static

leftJoinOn()

Adds a JOIN clause with "LEFT JOIN $table ON $conditional".

public leftJoinOn(Closure|array<string, Closure|string>|string $table, Closure $conditional) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

$conditional : Closure

Conditional expression

Return values
static

leftJoinUsing()

Adds a JOIN clause with "LEFT JOIN $table USING ...$columns".

public leftJoinUsing(Closure|array<string, Closure|string>|string $table, Closure|string ...$columns) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

$columns : Closure|string

Columns list

Return values
static

leftOuterJoinOn()

Adds a JOIN clause with "LEFT OUTER JOIN $table ON $conditional".

public leftOuterJoinOn(Closure|array<string, Closure|string>|string $table, Closure $conditional) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

$conditional : Closure

Conditional expression

Return values
static

leftOuterJoinUsing()

Adds a JOIN clause with "LEFT OUTER JOIN $table USING ...$columns".

public leftOuterJoinUsing(Closure|array<string, Closure|string>|string $table, Closure|string ...$columns) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

$columns : Closure|string

Columns list

Return values
static

naturalJoin()

Adds a JOIN clause with "NATURAL JOIN $table".

public naturalJoin(Closure|array<string, Closure|string>|string $table) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

Return values
static

naturalLeftJoin()

Adds a JOIN clause with "NATURAL LEFT JOIN $table".

public naturalLeftJoin(Closure|array<string, Closure|string>|string $table) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

Return values
static

naturalLeftOuterJoin()

Adds a JOIN clause with "NATURAL LEFT OUTER JOIN $table".

public naturalLeftOuterJoin(Closure|array<string, Closure|string>|string $table) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

Return values
static

naturalRightJoin()

Adds a JOIN clause with "NATURAL RIGHT JOIN $table".

public naturalRightJoin(Closure|array<string, Closure|string>|string $table) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

Return values
static

naturalRightOuterJoin()

Adds a JOIN clause with "NATURAL RIGHT OUTER JOIN $table".

public naturalRightOuterJoin(Closure|array<string, Closure|string>|string $table) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

Return values
static

options()

Sets the statement options.

public options(string $option, string ...$options) : static
Parameters
$option : string

One of the OPT_* constants

$options : string

Each option value must be one of the OPT_* constants

Return values
static

orderBy()

Appends columns to the ORDER BY clause.

public orderBy(Closure|string $column, Closure|string ...$columns) : static
Parameters
$column : Closure|string

The column name or a subquery

$columns : Closure|string

Extra column names and/or subqueries

Return values
static

orderByAsc()

Appends columns with the ASC direction to the ORDER BY clause.

public orderByAsc(Closure|string $column, Closure|string ...$columns) : static
Parameters
$column : Closure|string

The column name or a subquery

$columns : Closure|string

Extra column names and/or subqueries

Return values
static

orderByDesc()

Appends columns with the DESC direction to the ORDER BY clause.

public orderByDesc(Closure|string $column, Closure|string ...$columns) : static
Parameters
$column : Closure|string

The column name or a subquery

$columns : Closure|string

Extra column names and/or subqueries

Return values
static

orWhere()

Appends a "OR $column $operator ...$values" condition in the WHERE clause.

public orWhere(Closure|array<string|int, Closure|array<string|int, mixed>|string>|string $column, string $operator, Closure|array<string|int, Closure|array<string|int, mixed>|float|int|string|null>|float|int|string|null ...$values) : static
Parameters
$column : Closure|array<string|int, Closure|array<string|int, mixed>|string>|string

Closure for a subquery, a string with the column name or an array with column names on WHERE MATCH clause

$operator : string
$values : Closure|array<string|int, Closure|array<string|int, mixed>|float|int|string|null>|float|int|string|null
Return values
static

orWhereBetween()

Appends a "OR $column BETWEEN $min AND $max" condition in the WHERE clause.

public orWhereBetween(Closure|string $column, Closure|float|int|string|null $min, Closure|float|int|string|null $max) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$min : Closure|float|int|string|null
$max : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/between-and/
Return values
static

orWhereEqual()

Appends a "OR $column = $value" condition in the WHERE clause.

public orWhereEqual(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/equal/
Return values
static

orWhereGreaterThan()

Appends a "OR $column > $value" condition in the WHERE clause.

public orWhereGreaterThan(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/greater-than/
Return values
static

orWhereGreaterThanOrEqual()

Appends a "OR $column >= $value" condition in the WHERE clause.

public orWhereGreaterThanOrEqual(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/greater-than-or-equal/
Return values
static

orWhereIn()

Appends a "OR $column IN (...$values)" condition in the WHERE clause.

public orWhereIn(Closure|string $column, Closure|float|int|string|null $value, Closure|float|int|string|null ...$values) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
$values : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/in/
Return values
static

orWhereIsNotNull()

Appends a "OR $column IS NOT NULL" condition in the WHERE clause.

public orWhereIsNotNull(Closure|string $column) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

Tags
see
https://mariadb.com/kb/en/is-not-null/
Return values
static

orWhereIsNull()

Appends a "OR $column IS NULL" condition in the WHERE clause.

public orWhereIsNull(Closure|string $column) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

Tags
see
https://mariadb.com/kb/en/is-null/
Return values
static

orWhereLessThan()

Appends a "OR $column < $value" condition in the WHERE clause.

public orWhereLessThan(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/less-than/
Return values
static

orWhereLessThanOrEqual()

Appends a "OR $column <= $value" condition in the WHERE clause.

public orWhereLessThanOrEqual(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/less-than-or-equal/
Return values
static

orWhereLike()

Appends a "OR $column LIKE $value" condition in the WHERE clause.

public orWhereLike(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/like/
Return values
static

orWhereMatch()

Appends a "OR MATCH (...$columns) AGAINST ($against IN NATURAL LANGUAGE MODE)" fulltext searching in the WHERE clause.

public orWhereMatch(Closure|array<string|int, Closure|array<string|int, mixed>|string>|string $columns, Closure|array<string|int, Closure|array<string|int, mixed>|string>|string $against) : static
Parameters
$columns : Closure|array<string|int, Closure|array<string|int, mixed>|string>|string

Columns to MATCH

$against : Closure|array<string|int, Closure|array<string|int, mixed>|string>|string

AGAINST expression

Tags
see
https://mariadb.com/kb/en/full-text-index-overview/
https://mariadb.com/kb/en/match-against/
Return values
static

orWhereMatchInBooleanMode()

Appends a "OR MATCH (...$columns) AGAINST ($against IN BOOLEAN MODE)" fulltext searching in the WHERE clause.

public orWhereMatchInBooleanMode(Closure|array<string|int, Closure|array<string|int, mixed>|string>|string $columns, Closure|array<string|int, Closure|array<string|int, mixed>|string>|string $against) : static
Parameters
$columns : Closure|array<string|int, Closure|array<string|int, mixed>|string>|string

Columns to MATCH

$against : Closure|array<string|int, Closure|array<string|int, mixed>|string>|string

AGAINST expression

Tags
see
https://mariadb.com/kb/en/full-text-index-overview/
https://mariadb.com/kb/en/match-against/
Return values
static

orWhereMatchWithQueryExpansion()

Appends a "OR MATCH (...$columns) AGAINST ($against WITH QUERY EXPANSION)" fulltext searching in the WHERE clause.

public orWhereMatchWithQueryExpansion(Closure|array<string|int, Closure|array<string|int, mixed>|string>|string $columns, Closure|array<string|int, Closure|array<string|int, mixed>|string>|string $against) : static
Parameters
$columns : Closure|array<string|int, Closure|array<string|int, mixed>|string>|string

Columns to MATCH

$against : Closure|array<string|int, Closure|array<string|int, mixed>|string>|string

AGAINST expression

Tags
see
https://mariadb.com/kb/en/full-text-index-overview/
https://mariadb.com/kb/en/match-against/
Return values
static

orWhereNotBetween()

Appends a "OR $column NOT BETWEEN $min AND $max" condition in the WHERE clause.

public orWhereNotBetween(Closure|string $column, Closure|float|int|string|null $min, Closure|float|int|string|null $max) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$min : Closure|float|int|string|null
$max : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/not-between/
Return values
static

orWhereNotEqual()

Appends a "OR $column != $value" condition in the WHERE clause.

public orWhereNotEqual(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/not-equal/
Return values
static

orWhereNotIn()

Appends a "OR $column NOT IN (...$values)" condition in the WHERE clause.

public orWhereNotIn(Closure|string $column, Closure|float|int|string|null $value, Closure|float|int|string|null ...$values) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
$values : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/not-in/
Return values
static

orWhereNotLike()

Appends a "OR $column NOT LIKE $value" condition in the WHERE clause.

public orWhereNotLike(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/not-like/
Return values
static

orWhereNullSafeEqual()

Appends a "OR $column <=> $value" condition in the WHERE clause.

public orWhereNullSafeEqual(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/null-safe-equal/
Return values
static

reset()

Resets SQL clauses and parts.

public reset([string|null $sql = null ]) : static
Parameters
$sql : string|null = null

A part name or null to reset all

Tags
see
Statement::$sql
Return values
static

rightJoinOn()

Adds a JOIN clause with "RIGHT JOIN $table ON $conditional".

public rightJoinOn(Closure|array<string, Closure|string>|string $table, Closure $conditional) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

$conditional : Closure

Conditional expression

Return values
static

rightJoinUsing()

Adds a JOIN clause with "RIGHT JOIN $table USING ...$columns".

public rightJoinUsing(Closure|array<string, Closure|string>|string $table, Closure|string ...$columns) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

$columns : Closure|string

Columns list

Return values
static

rightOuterJoinOn()

Adds a JOIN clause with "RIGHT OUTER JOIN $table ON $conditional".

public rightOuterJoinOn(Closure|array<string, Closure|string>|string $table, Closure $conditional) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

$conditional : Closure

Conditional expression

Return values
static

rightOuterJoinUsing()

Adds a JOIN clause with "RIGHT OUTER JOIN $table USING ...$columns".

public rightOuterJoinUsing(Closure|array<string, Closure|string>|string $table, Closure|string ...$columns) : static
Parameters
$table : Closure|array<string, Closure|string>|string

Table factor

$columns : Closure|string

Columns list

Return values
static

run()

Runs the UPDATE statement.

public run() : int|string
Return values
int|string —

The number of affected rows

set()

Sets the SET clause.

public set(array<string, Closure|float|int|string|null>|object $columns) : static
Parameters
$columns : array<string, Closure|float|int|string|null>|object

Array of columns => values or an object to be cast to array

Return values
static

sql()

Renders the UPDATE statement.

public sql() : string
Return values
string

table()

Sets the table references.

public table(Closure|array<string, Closure|string>|string $reference, Closure|array<string, Closure|string>|string ...$references) : static
Parameters
$reference : Closure|array<string, Closure|string>|string
$references : Closure|array<string, Closure|string>|string
Return values
static

where()

Appends an "AND $column $operator ...$values" condition in the WHERE clause.

public where(Closure|array<string|int, Closure|array<string|int, mixed>|string>|string $column, string $operator, Closure|array<string|int, Closure|array<string|int, mixed>|float|int|string|null>|float|int|string|null ...$values) : static
Parameters
$column : Closure|array<string|int, Closure|array<string|int, mixed>|string>|string

Closure for a subquery, a string with the column name or an array with column names on WHERE MATCH clause

$operator : string
$values : Closure|array<string|int, Closure|array<string|int, mixed>|float|int|string|null>|float|int|string|null
Return values
static

whereBetween()

Appends an "AND $column BETWEEN $min AND $max" condition in the WHERE clause.

public whereBetween(Closure|string $column, Closure|float|int|string|null $min, Closure|float|int|string|null $max) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$min : Closure|float|int|string|null
$max : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/between-and/
Return values
static

whereEqual()

Appends an "AND $column = $value" condition in the WHERE clause.

public whereEqual(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/equal/
Return values
static

whereGreaterThan()

Appends an "AND $column > $value" condition in the WHERE clause.

public whereGreaterThan(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/greater-than/
Return values
static

whereGreaterThanOrEqual()

Appends an "AND $column >= $value" condition in the WHERE clause.

public whereGreaterThanOrEqual(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/greater-than-or-equal/
Return values
static

whereIn()

Appends an "AND $column IN (...$values)" condition in the WHERE clause.

public whereIn(Closure|string $column, Closure|float|int|string|null $value, Closure|float|int|string|null ...$values) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
$values : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/in/
Return values
static

whereIsNotNull()

Appends an "AND $column IS NOT NULL" condition in the WHERE clause.

public whereIsNotNull(Closure|string $column) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

Tags
see
https://mariadb.com/kb/en/is-not-null/
Return values
static

whereIsNull()

Appends an "AND $column IS NULL" condition in the WHERE clause.

public whereIsNull(Closure|string $column) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

Tags
see
https://mariadb.com/kb/en/is-null/
Return values
static

whereLessThan()

Appends an "AND $column < $value" condition in the WHERE clause.

public whereLessThan(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/less-than/
Return values
static

whereLessThanOrEqual()

Appends an "AND $column <= $value" condition in the WHERE clause.

public whereLessThanOrEqual(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/less-than-or-equal/
Return values
static

whereLike()

Appends an "AND $column LIKE $value" condition in the WHERE clause.

public whereLike(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/like/
Return values
static

whereMatch()

Appends an "AND MATCH (...$columns) AGAINST ($against IN NATURAL LANGUAGE MODE)" fulltext searching in the WHERE clause.

public whereMatch(Closure|array<string|int, Closure|array<string|int, mixed>|string>|string $columns, Closure|array<string|int, Closure|array<string|int, mixed>|string>|string $against) : static
Parameters
$columns : Closure|array<string|int, Closure|array<string|int, mixed>|string>|string

Columns to MATCH

$against : Closure|array<string|int, Closure|array<string|int, mixed>|string>|string

AGAINST expression

Tags
see
https://mariadb.com/kb/en/full-text-index-overview/
https://mariadb.com/kb/en/match-against/
Return values
static

whereMatchInBooleanMode()

Appends an "AND MATCH (...$columns) AGAINST ($against IN BOOLEAN MODE)" fulltext searching in the WHERE clause.

public whereMatchInBooleanMode(Closure|array<string|int, Closure|array<string|int, mixed>|string>|string $columns, Closure|array<string|int, Closure|array<string|int, mixed>|string>|string $against) : static
Parameters
$columns : Closure|array<string|int, Closure|array<string|int, mixed>|string>|string

Columns to MATCH

$against : Closure|array<string|int, Closure|array<string|int, mixed>|string>|string

AGAINST expression

Tags
see
https://mariadb.com/kb/en/full-text-index-overview/
https://mariadb.com/kb/en/match-against/
Return values
static

whereMatchWithQueryExpansion()

Appends an "AND MATCH (...$columns) AGAINST ($against WITH QUERY EXPANSION)" fulltext searching in the WHERE clause.

public whereMatchWithQueryExpansion(Closure|array<string|int, Closure|array<string|int, mixed>|string>|string $columns, Closure|array<string|int, Closure|array<string|int, mixed>|string>|string $against) : static
Parameters
$columns : Closure|array<string|int, Closure|array<string|int, mixed>|string>|string

Columns to MATCH

$against : Closure|array<string|int, Closure|array<string|int, mixed>|string>|string

AGAINST expression

Tags
see
https://mariadb.com/kb/en/full-text-index-overview/
https://mariadb.com/kb/en/match-against/
Return values
static

whereNotBetween()

Appends an "AND $column NOT BETWEEN $min AND $max" condition in the WHERE clause.

public whereNotBetween(Closure|string $column, Closure|float|int|string|null $min, Closure|float|int|string|null $max) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$min : Closure|float|int|string|null
$max : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/not-between/
Return values
static

whereNotEqual()

Appends an "AND $column != $value" condition in the WHERE clause.

public whereNotEqual(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/not-equal/
Return values
static

whereNotIn()

Appends an "AND $column NOT IN (...$values)" condition in the WHERE clause.

public whereNotIn(Closure|string $column, Closure|float|int|string|null $value, Closure|float|int|string|null ...$values) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
$values : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/not-in/
Return values
static

whereNotLike()

Appends an "AND $column NOT LIKE $value" condition.

public whereNotLike(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/not-like/
Return values
static

whereNullSafeEqual()

Appends an "AND $column <=> $value" condition in the WHERE clause.

public whereNullSafeEqual(Closure|string $column, Closure|float|int|string|null $value) : static
Parameters
$column : Closure|string

Closure for a subquery or a string with the column name

$value : Closure|float|int|string|null
Tags
see
https://mariadb.com/kb/en/null-safe-equal/
Return values
static

hasFrom()

Tells if the FROM clause was set.

protected hasFrom([string|null $clause = null ]) : bool
Parameters
$clause : string|null = null

A clause where FROM is required

Tags
throws
LogicException

if FROM is not set, but is required for some other clause

Return values
bool —

True if it has FROM, otherwise false

hasOptions()

Tells if the statement has options set.

protected hasOptions() : bool
Return values
bool

hasSet()

Tells if the SET clause was set.

protected hasSet() : bool
Return values
bool —

True if was set, otherwise false

renderAliasedIdentifier()

Renders a column part with an optional alias name, AS clause.

protected renderAliasedIdentifier(Closure|array<string, Closure|string>|string $column) : string
Parameters
$column : Closure|array<string, Closure|string>|string

The column name, a subquery or an array where the index is the alias and the value is the column/subquery

Return values
string

renderFrom()

Renders the FROM clause.

protected renderFrom() : string|null
Return values
string|null —

The FROM clause or null if it was not set

renderIdentifier()

Renders a column part.

protected renderIdentifier(Closure|string $column) : string
Parameters
$column : Closure|string

The column name or a subquery

Return values
string

renderJoin()

Renders the JOIN clause.

protected renderJoin() : string|null
Return values
string|null —

The JOIN clause or null if it was not set

renderLimit()

Renders the LIMIT clause.

protected renderLimit() : string|null
Return values
string|null

renderOptions()

protected renderOptions() : string|null
Return values
string|null

renderOrderBy()

Renders the ORDER BY clause.

protected renderOrderBy() : string|null
Return values
string|null —

The ORDER BY clause or null if it was not set

renderSet()

Renders the SET clause.

protected renderSet() : string|null
Return values
string|null —

The SET clause null if it was not set

renderSetCheckingConflicts()

Renders the SET clause checking conflicts.

protected renderSetCheckingConflicts() : string|null
Tags
throws
LogicException

if SET was set with columns or with the VALUES clause

Return values
string|null —

The SET part or null if it was not set

renderSetPart()

protected renderSetPart() : string
Return values
string

renderTable()

protected renderTable() : string
Return values
string

renderValue()

Renders a subquery or quote a value.

protected renderValue(Closure|float|int|string|null $value) : float|int|string
Parameters
$value : Closure|float|int|string|null

A Closure for subquery, other types to quote

Return values
float|int|string

renderWhere()

Renders the full WHERE (or HAVING) clause.

protected renderWhere([string $clause = 'where' ]) : string|null
Parameters
$clause : string = 'where'

where or having

Return values
string|null —

The full clause or null if has not a clause

setLimit()

Sets the LIMIT clause.

protected setLimit(int $limit[, int|null $offset = null ]) : static
Parameters
$limit : int
$offset : int|null = null
Tags
see
https://mariadb.com/kb/en/limit/
Return values
static

        
On this page

Search results