|
MediaWiki master
|
A query builder for DELETE queries with a fluent interface. More...
Inherits Wikimedia\Rdbms\IWriteQueryBuilder.

Public Member Functions | ||||
| __construct (IDatabase $db) | ||||
| Only for use in subclasses and Database::newDeleteQueryBuilder. | ||||
| andWhere ( $conds) | ||||
| Add conditions to the query. | ||||
| caller ( $fname) | ||||
Set the method name to be included in an SQL comment.
| ||||
| conds ( $conds) | ||||
| Add conditions to the query. | ||||
| connection (IDatabase $db) | ||||
Change the IDatabase object the query builder is bound to.The specified IDatabase will subsequently be used to execute the query.
| ||||
| delete (string $table) | ||||
| Set table for the query. | ||||
| deleteFrom (string $table) | ||||
| Set table for the query. | ||||
| execute () | ||||
| Run the constructed query. | ||||
| getQueryInfo () | ||||
Get an associative array describing the query in terms of its raw parameters to the counter-part method in Database object.This can be used to interface with legacy code.
| ||||
| queryInfo ( $info) | ||||
Set the query parameters to the given values, appending to the values which were already set.This can be used to interface with legacy code. If a key is omitted, the previous value will be retained.The parameters must be formatted as required by the counter-part method in Database object.
| ||||
| table (string $table) | ||||
| Manually set the table name to be passed to IDatabase::delete() | ||||
| where ( $conds) | ||||
| Add conditions to the query. | ||||
Protected Attributes | |
| IDatabase | $db |
A query builder for DELETE queries with a fluent interface.
Any particular query builder object should only be used for a single database query, and not be reused afterwards. However, to run multiple similar queries, you can create a “template” query builder to set up most of the query, and then clone the object (and potentially modify the clone) for each individual query.
Definition at line 20 of file DeleteQueryBuilder.php.
| Wikimedia\Rdbms\DeleteQueryBuilder::__construct | ( | IDatabase | $db | ) |
Only for use in subclasses and Database::newDeleteQueryBuilder.
To create a DeleteQueryBuilder instance, use $db->newDeleteQueryBuilder() instead.
Definition at line 42 of file DeleteQueryBuilder.php.
References Wikimedia\Rdbms\DeleteQueryBuilder\$db.
| Wikimedia\Rdbms\DeleteQueryBuilder::andWhere | ( | $conds | ) |
Add conditions to the query.
Alias for where().
| string|IExpression|array<string,?scalar|non-empty-array<int,?scalar|Blob>|RawSQLValue|Blob>|array<int,string|IExpression> | $conds |
Definition at line 175 of file DeleteQueryBuilder.php.
| Wikimedia\Rdbms\DeleteQueryBuilder::caller | ( | $fname | ) |
Set the method name to be included in an SQL comment.
| string | $fname |
Implements Wikimedia\Rdbms\IWriteQueryBuilder.
Definition at line 194 of file DeleteQueryBuilder.php.
| Wikimedia\Rdbms\DeleteQueryBuilder::conds | ( | $conds | ) |
Add conditions to the query.
Alias for where().
| string|IExpression|array<string,?scalar|non-empty-array<int,?scalar|Blob>|RawSQLValue|Blob>|array<int,string|IExpression> | $conds |
Definition at line 187 of file DeleteQueryBuilder.php.
| Wikimedia\Rdbms\DeleteQueryBuilder::connection | ( | IDatabase | $db | ) |
Change the IDatabase object the query builder is bound to.The specified IDatabase will subsequently be used to execute the query.
| IDatabase | $db |
Implements Wikimedia\Rdbms\IWriteQueryBuilder.
Definition at line 49 of file DeleteQueryBuilder.php.
| Wikimedia\Rdbms\DeleteQueryBuilder::delete | ( | string | $table | ) |
Set table for the query.
Alias for table().
| string | $table | The unqualified name of a table |
Definition at line 105 of file DeleteQueryBuilder.php.
| Wikimedia\Rdbms\DeleteQueryBuilder::deleteFrom | ( | string | $table | ) |
Set table for the query.
Alias for table().
| string | $table | The unqualified name of a table |
Definition at line 94 of file DeleteQueryBuilder.php.
| Wikimedia\Rdbms\DeleteQueryBuilder::execute | ( | ) |
Run the constructed query.
Implements Wikimedia\Rdbms\IWriteQueryBuilder.
Definition at line 202 of file DeleteQueryBuilder.php.
| Wikimedia\Rdbms\DeleteQueryBuilder::getQueryInfo | ( | ) |
Get an associative array describing the query in terms of its raw parameters to the counter-part method in Database object.This can be used to interface with legacy code.
Implements Wikimedia\Rdbms\IWriteQueryBuilder.
Definition at line 217 of file DeleteQueryBuilder.php.
| Wikimedia\Rdbms\DeleteQueryBuilder::queryInfo | ( | $info | ) |
Set the query parameters to the given values, appending to the values which were already set.This can be used to interface with legacy code. If a key is omitted, the previous value will be retained.The parameters must be formatted as required by the counter-part method in Database object.
| array | $info | Associative array of query info, with keys:
|
Implements Wikimedia\Rdbms\IWriteQueryBuilder.
Definition at line 62 of file DeleteQueryBuilder.php.
| Wikimedia\Rdbms\DeleteQueryBuilder::table | ( | string | $table | ) |
Manually set the table name to be passed to IDatabase::delete()
| string | $table | The unqualified name of a table |
Definition at line 82 of file DeleteQueryBuilder.php.
| Wikimedia\Rdbms\DeleteQueryBuilder::where | ( | $conds | ) |
Add conditions to the query.
The supplied conditions will be appended to the existing conditions, separated by AND.
| string|IExpression|array<string,?scalar|non-empty-array<int,?scalar|Blob>|RawSQLValue|Blob>|array<int,string|IExpression> | $conds |
May be either a string containing a single condition, or an array of conditions. If an array is given, the conditions constructed from each element are combined with AND.
Array elements may take one of two forms:
Note that expressions are often DBMS-dependent in their syntax. DBMS-independent wrappers are provided for constructing several types of expression commonly used in condition queries. See:
Untrusted user input is safe in the values of string keys, however untrusted input must not be used in the array key names or in the values of numeric keys. Escaping of untrusted input used in values of numeric keys should be done via IDatabase::addQuotes().
Definition at line 147 of file DeleteQueryBuilder.php.
|
protected |
Definition at line 36 of file DeleteQueryBuilder.php.
Referenced by Wikimedia\Rdbms\DeleteQueryBuilder\__construct().