Delete
extends Statement
in package
uses
Explain, Join, OrderBy, Where
Class Delete.
Tags
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'
- OPT_LOW_PRIORITY : string = 'LOW_PRIORITY'
- OPT_QUICK : string = 'QUICK'
Properties
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 DELETE statement.
- sql() : string
- Renders de DELETE 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.
- 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.
- renderTable() : string|null
- Renders the table references.
- 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_EXTENDED
public
string
EXP_EXTENDED
= 'EXTENDED'
Tags
EXP_FORMAT_JSON
public
string
EXP_FORMAT_JSON
= 'FORMAT=JSON'
Tags
EXP_PARTITIONS
https://mariadb.com/kb/en/partition-pruning-and-selection/.
public
string
EXP_PARTITIONS
= 'PARTITIONS'
OPT_IGNORE
public
string
OPT_IGNORE
= 'IGNORE'
OPT_LOW_PRIORITY
public
string
OPT_LOW_PRIORITY
= 'LOW_PRIORITY'
OPT_QUICK
public
string
OPT_QUICK
= 'QUICK'
Properties
$database
protected
Database
$database
$sql
SQL clauses and parts.
protected
array<string, mixed>
$sql
= []
Methods
__construct()
Statement constructor.
public
__construct(Database $database) : mixed
Parameters
- $database : Database
__toString()
public
__toString() : string
Return values
stringcrossJoin()
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
staticcrossJoinOn()
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
staticcrossJoinUsing()
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
staticexplain()
EXPLAIN provides information about statements.
public
explain([string|null $option = null ]) : array<int, Explain>
Parameters
- $option : string|null = null
Tags
Return values
array<int, Explain>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
Return values
staticinnerJoinOn()
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
staticinnerJoinUsing()
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
staticjoin()
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 OUTERor empty (same asINNER) - $clause : string|null = null
-
Condition clause. Null if it has a NATURAL type, otherwise
ONorUSING - $conditional : Closure|array<int, Closure|string>|null = null
-
A conditional expression as Closure or the columns list as array
Return values
staticjoinOn()
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
staticjoinUsing()
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
staticleftJoinOn()
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
staticleftJoinUsing()
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
staticleftOuterJoinOn()
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
staticleftOuterJoinUsing()
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
staticlimit()
Sets the LIMIT clause.
public
limit(int $limit) : static
Parameters
- $limit : int
Tags
Return values
staticnaturalJoin()
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
staticnaturalLeftJoin()
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
staticnaturalLeftOuterJoin()
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
staticnaturalRightJoin()
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
staticnaturalRightOuterJoin()
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
staticoptions()
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
staticorderBy()
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
staticorderByAsc()
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
staticorderByDesc()
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
staticorWhere()
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
staticorWhereBetween()
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
Return values
staticorWhereEqual()
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
Return values
staticorWhereGreaterThan()
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
Return values
staticorWhereGreaterThanOrEqual()
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
Return values
staticorWhereIn()
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
Return values
staticorWhereIsNotNull()
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
Return values
staticorWhereIsNull()
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
Return values
staticorWhereLessThan()
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
Return values
staticorWhereLessThanOrEqual()
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
Return values
staticorWhereLike()
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
Return values
staticorWhereMatch()
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
Return values
staticorWhereMatchInBooleanMode()
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
Return values
staticorWhereMatchWithQueryExpansion()
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
Return values
staticorWhereNotBetween()
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
Return values
staticorWhereNotEqual()
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
Return values
staticorWhereNotIn()
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
Return values
staticorWhereNotLike()
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
Return values
staticorWhereNullSafeEqual()
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
Return values
staticreset()
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
Return values
staticrightJoinOn()
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
staticrightJoinUsing()
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
staticrightOuterJoinOn()
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
staticrightOuterJoinUsing()
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
staticrun()
Runs the DELETE statement.
public
run() : int|string
Return values
int|string —The number of affected rows
sql()
Renders de DELETE statement.
public
sql() : string
Return values
stringtable()
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
-
The table name as string, a subquery as Closure or an array for aliased table where the key is the alias name and the value is the table name or a subquery
- $references : Closure|array<string, Closure|string>|string
-
Extra references. Same values as $reference
Return values
staticwhere()
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
staticwhereBetween()
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
Return values
staticwhereEqual()
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
Return values
staticwhereGreaterThan()
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
Return values
staticwhereGreaterThanOrEqual()
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
Return values
staticwhereIn()
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
Return values
staticwhereIsNotNull()
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
Return values
staticwhereIsNull()
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
Return values
staticwhereLessThan()
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
Return values
staticwhereLessThanOrEqual()
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
Return values
staticwhereLike()
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
Return values
staticwhereMatch()
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
Return values
staticwhereMatchInBooleanMode()
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
Return values
staticwhereMatchWithQueryExpansion()
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
Return values
staticwhereNotBetween()
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
Return values
staticwhereNotEqual()
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
Return values
staticwhereNotIn()
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
Return values
staticwhereNotLike()
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
Return values
staticwhereNullSafeEqual()
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
Return values
statichasFrom()
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
Return values
bool —True if it has FROM, otherwise false
hasOptions()
Tells if the statement has options set.
protected
hasOptions() : bool
Return values
boolrenderAliasedIdentifier()
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
stringrenderAssignment()
Renders an assignment part.
protected
renderAssignment(string $identifier, Closure|float|int|string|null $expression) : string
Parameters
- $identifier : string
-
Identifier/column name
- $expression : Closure|float|int|string|null
-
Expression/value
Tags
Return values
stringrenderFrom()
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
stringrenderJoin()
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|nullrenderOptions()
protected
renderOptions() : string|null
Return values
string|nullrenderOrderBy()
Renders the ORDER BY clause.
protected
renderOrderBy() : string|null
Return values
string|null —The ORDER BY clause or null if it was not set
renderTable()
Renders the table references.
protected
renderTable() : string|null
Return values
string|null —The table references or null if none was set
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|stringrenderWhere()
Renders the full WHERE (or HAVING) clause.
protected
renderWhere([string $clause = 'where' ]) : string|null
Parameters
- $clause : string = 'where'
-
whereorhaving
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
Return values
staticsubquery()
Returns an SQL part between parentheses.
protected
subquery(Closure $subquery) : string
Parameters
- $subquery : Closure
-
A Closure having the current Manipulation instance as first argument. The returned value must be scalar