spoof
|
Static Protected Attributes | |
static | $randomTags = array() |
Database language implementation for SQL
getCondition | ( | \lib360\db\driver\IDriver | $driver, |
\lib360\db\condition\ICondition | $condition | ||
) |
Gets query of the condition using driver-specific syntax.
\lib360\db\driver\IDriver | $driver | database driver |
\lib360\db\condition\ICondition | $condition | database condition object |
Implements ILanguage.
getConditionGroupOperator | ( | \lib360\db\driver\IDriver | $driver, |
$operator | |||
) |
Returns SQL operator for given condition group object operator
\lib360\db\driver\IDriver | $driver | database driver object |
integer | $operator | one of operator constants' values |
\lib360\db\language\SQLException | when illegal or unsupported operator given |
getConditionOperator | ( | \lib360\db\driver\IDriver | $driver, |
\lib360\db\condition\ICondition | $condition | ||
) |
Returns condition operator for the given object
\lib360\db\driver\IDriver | $driver | database driver object |
\lib360\db\condition\ICondition | $condition | database condition object |
\lib360\db\language\SQLException | when condition operator is invalid or unsupported |
getDelete | ( | \lib360\db\driver\IDriver | $driver, |
\lib360\db\data\IStore | $storage, | ||
\lib360\db\condition\ICondition | $condition = NULL |
||
) |
Returns query object for full delete statement
\lib360\db\driver\IDriver | $driver | database driver |
\lib360\db\data\IStore | $storage | database storage object |
\lib360\db\condition\ICondition | $condition | optional database condition object, default NULL |
Implements ILanguage.
getFieldFormatted | ( | \lib360\db\driver\IDriver | $driver, |
$field | |||
) |
Returns formatted SQL field string
\lib360\db\driver\IDriver | $driver | database driver |
string | $field | unformatted raw field |
getInsert | ( | \lib360\db\driver\IDriver | $driver, |
\lib360\db\data\IStore | $storage, | ||
array | $data | ||
) |
Returns query object for full insert statement
\lib360\db\driver\IDriver | $driver | database driver |
\lib360\db\data\IStore | $storage | database storage object |
array | $data | associative array of field => to insert |
Implements ILanguage.
getInsertFields | ( | \lib360\db\driver\IDriver | $driver, |
array | $data | ||
) |
Returns formatted string of fields for insert query
\lib360\db\driver\IDriver | $driver | database driver |
array | $data | associative array of field => to insert |
getInsertValues | ( | \lib360\db\driver\IDriver | $driver, |
array | $data | ||
) |
Gererates a query object for "values" section of the insert query
\lib360\db\driver\IDriver | $driver | database driver |
array | $data | associative array of field => to insert |
getJoin | ( | \lib360\db\driver\IDriver | $driver, |
\lib360\db\join\IJoin | $join | ||
) |
Generates a query object for a database join
\lib360\db\driver\IDriver | $driver | database driver |
\lib360\db\join\IJoin | $join | database join |
getRandomTag | ( | $n = 4 , |
|
$unique = TRUE , |
|||
$addToUniqueList = TRUE |
|||
) |
Returns a random and optionally unique (per process) alphanumeric string of a specified length @param $n integer length; optional, default 4 @param $unique boolean whether tag should be unique; optional, default TRUE @param $addToUniqueList boolean whether to add to unique list; optional, default TRUE @return random string
getSelect | ( | \lib360\db\driver\IDriver | $driver, |
\lib360\db\data\IStore | $storage, | ||
\lib360\db\condition\ICondition | $condition = NULL , |
||
array | $fields = NULL |
||
) |
Returns query object for full select statement
\lib360\db\driver\IDriver | $driver | database driver |
\lib360\db\data\IStore | $storage | database storage object |
\lib360\db\condition\ICondition | $condition | optional database condition object, default NULL |
array | $fields | optional (optionally associative) array of fields to query and return, default NULL |
Implements ILanguage.
getSelectFieldFormatted | ( | \lib360\db\driver\IDriver | $driver, |
$field_key, | |||
$field_value | |||
) |
Returns formatted field for select statement If associative array given the result will be "key AS value" If non-associative array given element value will be used as the field name
\lib360\db\driver\IDriver | $driver | database driver |
mixed | $field_key | can be associative string key or integer |
string | $field_value | field name |
getSelectFields | ( | \lib360\db\driver\IDriver | $driver, |
array | $fields = NULL |
||
) |
Returns formatted list of fields for select statement
\lib360\db\driver\IDriver | $driver | database driver |
array | $fields | optional (optionally associative) array of fields to format |
getSelectFrom | ( | \lib360\db\driver\IDriver | $driver, |
\lib360\db\data\IStore | $storage | ||
) |
Returns the "from" section of the SQL select query for the given storage object
\lib360\db\driver\IDriver | $driver | database driver |
\lib360\db\data\IStore | $storage | or object for which the result will be generated |
\InvalidArgumentException | when invalid or unsupported storage object type is given |
getSelectFromTable | ( | \lib360\db\driver\IDriver | $driver, |
\lib360\db\data\ITable | $storage | ||
) |
Returns formatted table name for the storage object
\lib360\db\driver\IDriver | $driver | database driver |
\lib360\db\data\ITable | $storage | storage object for which the result will be generated |
getSelectFromTableName | ( | \lib360\db\driver\IDriver | $driver, |
$name | |||
) |
Formats table name from the raw table name string
\lib360\db\driver\IDriver | $driver | database driver |
string | $name | table name |
getSelectFromView | ( | \lib360\db\driver\Driver | $driver, |
\lib360\db\data\View | $storage | ||
) |
Returns query object for the "from" portion of the select query for a view
\lib360\db\driver\IDriver | $driver | database driver |
\lib360\db\data\IView | $storage | database view object |
\InvalidArgumentException | when any of the view joins are not , , or string table name |
getUpdate | ( | \lib360\db\driver\IDriver | $driver, |
\lib360\db\data\IStore | $storage, | ||
array | $fields, | ||
\lib360\db\condition\ICondition | $condition = NULL |
||
) |
Returns query object for full update statement
\lib360\db\driver\IDriver | $driver | database driver |
\lib360\db\data\IStore | $storage | database storage object |
array | $fields | associative array of field => IDBValue to update |
\lib360\db\condition\ICondition | $condition | optional database condition object, default NULL |
Implements ILanguage.
getUpdateFields | ( | \lib360\db\driver\IDriver | $driver, |
array | $fields | ||
) |
Returns query object for "set" section of the update query
\lib360\db\driver\IDriver | $driver | database driver |
array | $fields | associative array of field => IDBValue |
getValue | ( | \lib360\db\driver\IDriver | $driver, |
\lib360\db\value\IValue | $value | ||
) |
Returns object for given IDBValue
\lib360\db\driver\IDriver | $driver | database driver object |
\lib360\db\value\IValue | $value | database value object |
|
staticprotected |
Internal property to store tags already generated; used to verify uniqueness of a new tag
const BIND_CHAR = ':' |
const CONDITION_EQUALS = '=' |
const CONDITION_EQUALS_NULL = 'is' |
const CONDITION_GREATER_THAN = '>' |
const CONDITION_GREATER_THAN_OR_EQUAL = '>=' |
const CONDITION_IN = 'in' |
const CONDITION_LESS_THAN = '<' |
const CONDITION_LESS_THAN_OR_EQUAL = '<=' |
const CONDITION_NOT_EQUALS = '<>' |
const CONDITION_NOT_EQUALS_NULL = 'is not' |
const CONDITION_NOT_IN = 'not in' |
const CONDITION_VALUES_SEPARATOR = ', ' |
const CONDITION_VALUES_WRAPPER_END = ')' |
const CONDITION_VALUES_WRAPPER_START = '(' |
const CONDITION_WRAPPER_END = ')' |
const CONDITION_WRAPPER_START = '(' |
const CONDITIONGROUP_AND = 'and' |
const CONDITIONGROUP_OR = 'or' |
const DELETE = 'delete' |
const EQUALS = '=' |
const FROM = 'from' |
const INSERT = 'insert' |
const INSERT_FIELD_SEPARATOR = ', ' |
const INSERT_INTO = 'into' |
const INSERT_VALUES = 'values' |
const INSERT_VALUES_WRAPPER_END = ')' |
const INSERT_VALUES_WRAPPER_START = '(' |
const JOIN_TYPE_FULL = 'full join' |
const JOIN_TYPE_INNER = 'inner join' |
const JOIN_TYPE_JOIN = 'join' |
const JOIN_TYPE_LEFT_OUTER = 'left outer join' |
const JOIN_TYPE_RIGHT_OUTER = 'right outer join' |
const SELECT = 'select' |
const SELECT_AS = 'as' |
const SELECT_FIELD_SEPARATOR = ', ' |
const SELECT_FIELDS_ALL = '*' |
const SELECT_JOIN_ON = 'on' |
const SELECT_JOIN_SEPARATOR = ', ' |
const UPDATE = 'update' |
const UPDATE_FIELD_SEPARATOR = ', ' |
const UPDATE_SET = 'set' |
const VALUE_NULL = 'null' |
const WHERE = 'where' |