Public Method Details |
quotedValue |
public string quotedValue( string $value )
|
|
Returns a single-quoted value. Returns a quoted $value with backslashes before characters that need to be quoted in database queries, etc. These characters are a single quote ('), a double quote ("), a backslash (\) and NUL (the NULL byte).
|
Parameter |
|
|
Returns |
string |
|
composeInsertQuery |
public string composeInsertQuery( string $table, array $values )
|
|
Returns the INSERT SQL query string. Returns the composed INSERT SQL query string.
|
Parameter |
|
|
|
array |
$values |
|
|
Array of values to insert. Array keys should be an integer or FIELD_NAMES. |
|
Returns |
string SQL query |
|
composeUpdateQuery |
public string composeUpdateQuery( string $table, array $values, mixed $conditions )
|
|
Returns the UPDATE SQL query string. Returns the composed UPDATE SQL query string.
|
Parameter |
|
string |
$table |
|
|
Table name. |
|
|
array |
$values |
|
|
Array of values to update. Array keys should be FIELD_NAMES. |
|
|
mixed |
$conditions |
|
|
Conditions, an array or string, if needed. |
|
Returns |
string SQL query. |
|
composeSelectQuery |
public string composeSelectQuery( mixed $tables, mixed $fields, mixed $conditions )
|
|
Returns the SELECT SQL query string. Returns the composed SELECT SQL query string.
|
Parameter |
|
mixed |
$tables |
|
|
Tables names, array or string. |
|
|
mixed |
$fields |
|
|
Fields names, array or string. |
|
|
mixed |
$conditions |
|
|
Conditions, an array or string, if needed. |
|
Returns |
string SQL query. |
|
composeDeleteQuery |
public string composeDeleteQuery( string $table, mixed $conditions )
|
|
Returns the DELETE SQL query string. Returns the composed DELETE SQL query string.
|
Parameter |
|
string |
$table |
|
|
Table name. |
|
|
mixed |
$conditions |
|
|
Conditions, an array or string, if needed. |
|
Returns |
string SQL query. |
|
simpleConditions |
public string simpleConditions( mixed $conditions )
|
|
Returns the simple condition string. Return the composed simple condition string. The string returned should begin with "WHERE" if $conditions is an array.
|
Parameter |
|
mixed |
$conditions |
|
|
Conditions, an array or string. |
|
Returns |
string SQL query WHERE part. |
|
composeQueryConditions |
public string composeQueryConditions( mixed $conditions, [ integer $type, array $limit, array $parameters, array $orderby, array $groupby ] )
|
|
Returns SQL query end part. Returns the composed WHERE, LIMIT, ORDER BY and GROUP BY parts of an SQL query.
|
Parameter |
|
|
|
integer |
$type |
= >>1<< |
|
Type of condition:
- CND_EQUALITY - equalityConditions;
- CND_HOMOGENIC - homogenicConditions;
- CND_COMPLEX - complexConditions;
- CND_SIMPLE - simpleConditions;
- CND_DUMMY - dummyCondition.
|
|
|
array |
$limit |
= >>array()<< |
|
Where $limit[0] - oofset, $limit[1] - rows. |
|
|
array |
$parameters |
= >>array()<< |
|
Additional parameters. If $type == CND_HOMOGENIC, you need to specify $parameters["relation"] and $parameters["operation"]. |
|
|
array |
$orderby |
= >>array()<< |
|
$orderby[0] - string or array - field(s), $orderby[1] - direction (ASC, DESC). |
|
|
array |
$groupby |
= >>array()<< |
|
|
|
Returns |
string |
|