CRM_Utils_SQL_Delete
class CRM_Utils_SQL_Delete extends CRM_Utils_SQL_BaseParamQuery
Dear God Why Do I Have To Write This (Dumb SQL Builder)
Usage:
Constants
INTERPOLATE_INPUT |
Interpolate values as soon as they are passed in (where(), join(), etc). Default. Pro: Every clause has its own unique namespace for parameters. Con: Probably slower. Advice: Use this when aggregating SQL fragments from agents who maintained by different parties. |
INTERPOLATE_OUTPUT |
Interpolate values when rendering SQL output (toSQL()). Pro: Probably faster. Con: Must maintain an aggregated list of all parameters. Advice: Use this when you have control over the entire query. |
INTERPOLATE_AUTO |
Determine mode automatically. When the first attempt is made to use input-interpolation (eg `where(. .., array(...)) |
Properties
protected mixed | $mode | from CRM_Utils_SQL_BaseParamQuery | |
protected array | $params | from CRM_Utils_SQL_BaseParamQuery | |
bool | $strict | Public to work-around PHP 5.3 limit. | from CRM_Utils_SQL_BaseParamQuery |
Methods
Enable (or disable) strict mode.
Given a string like "field_name = @value", replace "@value" with an escaped SQL string
Set one (or multiple) parameters to interpolate into the query.
Set the value of a SQL parameter.
Create a new DELETE query.
Create a new DELETE query.
Make a new copy of this query.
Limit results by adding extra condition(s) to the WHERE clause
No description
No description
Execute the query.
Details
in CRM_Utils_SQL_BaseParamQuery at line 63
CRM_Utils_SQL_BaseParamQuery
strict(bool $strict = TRUE)
Enable (or disable) strict mode.
In strict mode, unknown variables will generate exceptions.
in CRM_Utils_SQL_BaseParamQuery at line 84
string
interpolate(string $expr, null|array $args, string $activeMode = self::INTERPOLATE_INPUT)
Given a string like "field_name = @value", replace "@value" with an escaped SQL string
in CRM_Utils_SQL_BaseParamQuery at line 146
string
escapeString(string|NULL $value)
at line 190
$this
param(array|string $keys, null|mixed $value = NULL)
Set one (or multiple) parameters to interpolate into the query.
in CRM_Utils_SQL_BaseParamQuery at line 187
bool
offsetExists(string $offset)
Has an offset been set.
in CRM_Utils_SQL_BaseParamQuery at line 205
mixed
offsetGet(string $offset)
Get the value of a SQL parameter.
in CRM_Utils_SQL_BaseParamQuery at line 226
offsetSet(string $offset, mixed $value)
Set the value of a SQL parameter.
in CRM_Utils_SQL_BaseParamQuery at line 237
offsetUnset(string $offset)
Unset the value of a SQL parameter.
at line 95
static CRM_Utils_SQL_Delete
from(string $from, array $options = [])
Create a new DELETE query.
at line 106
__construct(string $from, array $options = [])
Create a new DELETE query.
at line 116
CRM_Utils_SQL_Delete
copy()
Make a new copy of this query.
at line 128
CRM_Utils_SQL_Delete
merge(CRM_Utils_SQL_Delete $other, array|NULL $parts = NULL)
Merge something or other.
at line 170
CRM_Utils_SQL_Delete
where(string|array $exprs, null|array $args = NULL)
Limit results by adding extra condition(s) to the WHERE clause
at line 201
bool
isEmpty(array|NULL $parts = NULL)
at line 222
string
toSQL()
at line 253
CRM_Core_DAO
execute(string|NULL $daoName = NULL, bool $i18nRewrite = TRUE)
Execute the query.
To examine the results, use a function like fetch()
, fetchAll()
,
fetchValue()
, or fetchMap()
.