PHP 클래스 lithium\data\source\Database

상속: extends lithium\data\Source
파일 보기 프로젝트 열기: unionofrad/lithium 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$connection PD\PDO Holds the current connection.

보호된 프로퍼티들

프로퍼티 타입 설명
$_cachedNames array Holds cached names.
$_classes array Classes used by Database.
$_columns array The supported column types and their default values
$_constraintTypes
$_operators array List of SQL operators, paired with handling options.
$_quotes array A pair of opening/closing quote characters used for quoting identifiers in SQL queries.
$_strategies array Array of named callable objects representing different strategies for performing specific types of queries.
$_strings array Strings used to render the given statement

공개 메소드들

메소드 설명
__construct ( array $config = [] ) : void Constructor.
alias ( $alias, $context )
applyStrategy ( array $options, object $context ) Applying a strategy to a lithium\data\model\Query object
calculation ( string $type, mixed $query, array $options = [] ) : integer | null Executes calculation-related queries, such as those required for count and other aggregates.
cast ( $entity, array $data, array $options = [] )
column ( $field ) : string Generate a database-native column schema string
comment ( string $comment ) : string Adds formatting to SQL comments before they're embedded in queries.
conditions ( string | array $conditions, object $context, array $options = [] ) : string Returns a string of formatted conditions to be inserted into the query statement. If the query conditions are defined as an array, key pairs are converted to SQL strings.
connect ( ) : boolean Connects to the database by creating a PDO intance using the constructed DSN string.
constraints ( string | array $constraints, Query $context, array $options = [] ) : string Returns a string of formatted constraints to be inserted into the query statement.
create ( object $query, array $options = [] ) : boolean Inserts a new record into the database based on a the Query. The record is updated with the id of the insert.
createSchema ( string $source, object $schema ) : boolean Create a database-native schema
delete ( object $query, array $options = [] ) : boolean Deletes a record in the database based on the given Query.
disconnect ( ) : boolean Disconnects the adapter from the database.
dropSchema ( string $source, boolean $soft = true ) : boolean Drops a table.
encoding ( mixed $encoding = null ) : mixed. Getter/Setter for the connection's encoding Abstract. Must be defined by child class.
error ( ) Return the last errors produced by a the execution of a query.
fields ( array $fields, object $context ) : string Returns a string of formatted fields to be inserted into the query statement.
group ( string | array $group, object $context ) : string | null Return formatted clause for GROUP BY with known fields escaped.
having ( string | array $conditions, object $context, array $options = [] ) : string Returns a string of formatted havings to be inserted into the query statement. If the query havings are defined as an array, key pairs are converted to SQL strings.
join ( object $context, object $rel, string $fromAlias = null, string $toAlias = null, mixed $constraints = [] ) Set a query's join according a Relationship.
joins ( array $joins, Query $context ) : string Returns a join statement for given array of query objects
limit ( integer $limit, Query $context ) : string Returns a LIMIT statement from the given limit and the offset of the context object.
methods ( ) : array Determines the set of methods to be used when exporting query values.
name ( string $name ) : string Field name handler to ensure proper escaping.
on ( object $rel, $aliasFrom = null, $aliasTo = null, array $constraints = [] ) : array Build the ON constraints from a Relationship instance
order ( string | array $order, object $context ) : string | null Return formatted clause for ORDER BY with known fields escaped and directions normalized to uppercase. When order direction is missing or unrecognized defaults to ASC.
read ( string | object $query, array $options = [] ) : mixed Reads records from a database using a lithium\data\model\Query object or raw SQL string.
relationship ( string $class, string $type, string $name, array $config = [] ) : array Defines or modifies the default settings of a relationship between two models.
renderCommand ( string $type, string $data = null, string $context = null ) : string Returns a given type statement for the given data, rendered from Database::$_strings.
schema ( Query $query, Result | null $resource = null, object | null $context = null ) : array Builds an array of keyed on the fully-namespaced Model with array of fields as values for the given Query
update ( object $query, array $options = [] ) : boolean Updates a record in the database based on the given Query.
value ( mixed $value, array $schema = [] ) : mixed Converts a given value into the proper type based on a given schema definition.

보호된 메소드들

메소드 설명
_aliasing ( string $name, string $alias, array $map = [] ) : string Helper which add an alias basename to a field name if necessary
_buildConstraints ( array $constraints, type $schema = null, type $joiner = ' ', $primary = false ) : string Helper for building columns constraints
_buildMetas ( $type, array $metas, array $names = null, type $joiner = ' ' ) : string Helper for building columns metas
_cast ( string $type, string $value, array $column, array $schema = [] ) : mixed Cast a value according to a column type, used by Database::value().
_conditions ( string | array $conditions, object $context, array $options = [] ) : string Returns a string of formatted conditions to be inserted into the query statement.
_constraint ( string $name, mixed $value, object $schema = null ) : string Build a SQL column constraint
_constraints ( array $constraints ) : array Auto escape string value to a field name value
_createFields ( array $data, array $schema, object $context ) : array Renders the fields part for _create_ queries.
_entityName ( string $entity, array $options = [] ) : string Returns a fully-qualified table name (i.e. with prefix), quoted.
_error ( string $sql ) Throw a QueryException error
_execute ( string $sql ) : Result Execute a given query Abstract. Must be defined by child class.
_fieldName ( string $field ) : string Return the field name from a conditions key.
_fields ( array $fields, object $context ) : array Reformats fields to be alias based.
_fieldsQuote ( string $alias, string $field ) : string Quotes fields, also handles aliased fields.
_fieldsReturn ( string $type, object $context, array $fields, array $schema ) : string | array Renders the fields SQL fragment for queries.
_formatters ( ) : array Provide an associative array of Closures to be used as the 'formatter' key inside of the Database::$_columns specification. Each Closure should return the appropriately quoted or unquoted value and accept one or two parameters: $format, the format to apply to value and $value, the value to be formatted.
_init ( ) Initializer. Initializes properties like Database::$_strategies because closures cannot be created within the class definition.
_insertId ( $query ) : void Get the last insert id from the database.
_introspectType ( mixed $value ) : string Attempts to automatically determine the column type of a value. Used by the value() method of various database adapters to determine how to prepare a value if the schema is not specified.
_meta ( string $type, string $name, mixed $value ) : string Build a SQL column/table meta.
_on ( array $constraints, $aliasFrom, $aliasTo, $mapAlias = [] )
_operator ( string $key, mixed $value, array $schema = [], array $options = [] ) : string Handles conversion of SQL operator keys to SQL statements.
_processConditions ( $key, $value, $context, $schema = null, $glue = 'AND' )
_processOperator ( $key, $value, $fieldMeta, $glue ) : mixed Helper method used by _processConditions.
_queryExport ( object $query ) : array Helper method for Database::read() to export query while handling additional joins when using relationships and limited result sets. Filters conditions on subsequent queries to just the ones applying to the relation.
_schema ( Query $query, array | null $fields = null ) : array Helper method for data\model\Database::shema()
_splitFieldname ( string $field ) : array Return the alias and the field name from an identifier name.
_toBoolean ( mixed $value ) : boolean Casts a value which is being written or compared to a boolean-type database column.
_updateFields ( array $data, array $schema, object $context ) : string Renders the fields part for _update_ queries.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( array $config = [] ) : void
$config array array Available configuration options are: - `'database'` _string_: Name of the database to use. Defaults to `null`. - `'host'` _string_: Name/address of server to connect to. Defaults to `'localhost'`. - `'login'` _string_: Username to use when connecting to server. Defaults to `'root'`. - `'password'` _string_: Password to use when connecting to server. Defaults to `''`. - `'persistent'` _boolean_: If true a persistent connection will be attempted, provided the adapter supports it. Defaults to `true`.
리턴 void

_aliasing() 보호된 메소드

Helper which add an alias basename to a field name if necessary
protected _aliasing ( string $name, string $alias, array $map = [] ) : string
$name string The field name.
$alias string The alias name
$map array An array of `'modelname' => 'aliasname'` mapping
리턴 string

_buildConstraints() 보호된 메소드

Helper for building columns constraints
또한 보기: lithium\data\soure\Database::createSchema()
protected _buildConstraints ( array $constraints, type $schema = null, type $joiner = ' ', $primary = false ) : string
$constraints array The array of constraints
$schema type The schema of the table
$joiner type The join character
리턴 string The SQL constraints

_buildMetas() 보호된 메소드

Helper for building columns metas
또한 보기: lithium\data\soure\Database::createSchema()
또한 보기: lithium\data\soure\Database::column()
protected _buildMetas ( $type, array $metas, array $names = null, type $joiner = ' ' ) : string
$metas array The array of column metas.
$names array If `$names` is not `null` only build meta present in `$names`
$joiner type The join character
리턴 string The SQL constraints

_cast() 보호된 메소드

Cast a value according to a column type, used by Database::value().
또한 보기: lithium\data\source\Database::value()
protected _cast ( string $type, string $value, array $column, array $schema = [] ) : mixed
$type string Name of the column type.
$value string Value to cast.
$column array The column definition.
$schema array Formatted array from `lithium\data\source\Database::schema()`.
리턴 mixed Casted value.

_conditions() 보호된 메소드

If the query conditions are defined as an array, key pairs are converted to SQL strings. If $key is numeric and $value is a string, $value is treated as a literal SQL fragment and returned.
protected _conditions ( string | array $conditions, object $context, array $options = [] ) : string
$conditions string | array The conditions for this query.
$context object The current `lithium\data\model\Query` instance.
$options array Available options are: - `'prepend'` _boolean|string_: The string to prepend or `false` for no prepending. Defaults to `false`.
리턴 string Returns an SQL conditions clause.

_constraint() 보호된 메소드

Build a SQL column constraint
protected _constraint ( string $name, mixed $value, object $schema = null ) : string
$name string The name of the meta to build
$value mixed The value used for building the meta
$schema object A `Schema` instance.
리턴 string The SQL meta string

_constraints() 보호된 메소드

Auto escape string value to a field name value
protected _constraints ( array $constraints ) : array
$constraints array The constraints array
리턴 array The escaped constraints array

_createFields() 보호된 메소드

Renders the fields part for _create_ queries.
또한 보기: lithium\data\source\Database::_fieldsReturn()
protected _createFields ( array $data, array $schema, object $context ) : array
$data array
$schema array An array defining the schema of the fields used in the criteria.
$context object Generally a `data\model\Query` instance.
리턴 array Array with `fields` and `values` keys which hold SQL fragments of fields an values separated by comma.

_entityName() 보호된 메소드

Returns a fully-qualified table name (i.e. with prefix), quoted.
protected _entityName ( string $entity, array $options = [] ) : string
$entity string A table name or fully-namespaced model class name.
$options array Available options: - `'quoted'` _boolean_: Indicates whether the name should be quoted.
리턴 string Returns a quoted table name.

_error() 보호된 메소드

Throw a QueryException error
protected _error ( string $sql )
$sql string The offending SQL string

_execute() 추상적인 보호된 메소드

Execute a given query Abstract. Must be defined by child class.
또한 보기: lithium\data\source\Database::renderCommand()
abstract protected _execute ( string $sql ) : Result
$sql string The sql string to execute
리턴 Result Returns a result object if the query was successful.

_fieldName() 보호된 메소드

Return the field name from a conditions key.
protected _fieldName ( string $field ) : string
$field string Field or identifier name.
리턴 string Returns the field name without the table alias, if applicable.

_fields() 보호된 메소드

Reformats fields to be alias based.
또한 보기: lithium\data\source\Database::fields()
또한 보기: lithium\data\source\Database::schema()
protected _fields ( array $fields, object $context ) : array
$fields array Array of fields.
$context object Generally a `data\model\Query` instance.
리턴 array Reformatted fields

_fieldsQuote() 보호된 메소드

Quotes fields, also handles aliased fields.
또한 보기: lithium\data\source\Database::fields()
protected _fieldsQuote ( string $alias, string $field ) : string
$alias string
$field string
리턴 string The quoted field.

_fieldsReturn() 보호된 메소드

Renders the fields SQL fragment for queries.
또한 보기: lithium\data\source\Database::fields()
protected _fieldsReturn ( string $type, object $context, array $fields, array $schema ) : string | array
$type string Type of query i.e. `'create'` or `'update'`.
$context object Generally a `data\model\Query` instance.
$fields array
$schema array An array defining the schema of the fields used in the criteria.
리턴 string | array

_formatters() 보호된 메소드

Example formatter function: function($format, $value) { return is_numeric($value) ? (integer) $value : false; }
또한 보기: lithium\data\source\Database::$_columns
또한 보기: lithium\data\source\Database::_init()
protected _formatters ( ) : array
리턴 array of column types to Closure formatter

_init() 보호된 메소드

Initializer. Initializes properties like Database::$_strategies because closures cannot be created within the class definition.
또한 보기: lithium\data\source\Database::$_columns
또한 보기: lithium\data\source\Database::$_strings
또한 보기: lithium\data\source\Database::$_strategies
protected _init ( )

_insertId() 추상적인 보호된 메소드

Abstract. Must be defined by child class.
abstract protected _insertId ( $query ) : void
$query lithium\data\model\Query $context The given query.
리턴 void

_introspectType() 보호된 메소드

Attempts to automatically determine the column type of a value. Used by the value() method of various database adapters to determine how to prepare a value if the schema is not specified.
protected _introspectType ( mixed $value ) : string
$value mixed The value to be prepared for an SQL query.
리턴 string Returns the name of the column type which `$value` most likely belongs to.

_meta() 보호된 메소드

Build a SQL column/table meta.
protected _meta ( string $type, string $name, mixed $value ) : string
$type string The type of the meta to build (possible values: `'table'` or `'column'`).
$name string The name of the meta to build.
$value mixed The value used for building the meta.
리턴 string The SQL meta string.

_on() 보호된 메소드

protected _on ( array $constraints, $aliasFrom, $aliasTo, $mapAlias = [] )
$constraints array

_operator() 보호된 메소드

Handles conversion of SQL operator keys to SQL statements.
protected _operator ( string $key, mixed $value, array $schema = [], array $options = [] ) : string
$key string Key in a conditions array. Usually a field name.
$value mixed An SQL operator or comparison value.
$schema array An array defining the schema of the field used in the criteria.
$options array
리턴 string Returns an SQL string representing part of a `WHERE` clause of a query.

_processConditions() 보호된 메소드

protected _processConditions ( $key, $value, $context, $schema = null, $glue = 'AND' )

_processOperator() 보호된 메소드

Helper method used by _processConditions.
protected _processOperator ( $key, $value, $fieldMeta, $glue ) : mixed
리턴 mixed Returns the operator expression string or `false` if no operator is applicable.

_queryExport() 보호된 메소드

Helper method for Database::read() to export query while handling additional joins when using relationships and limited result sets. Filters conditions on subsequent queries to just the ones applying to the relation.
또한 보기: lithium\data\source\Database::read()
protected _queryExport ( object $query ) : array
$query object The query object.
리턴 array The exported query returned by reference.

_schema() 보호된 메소드

Helper method for data\model\Database::shema()
protected _schema ( Query $query, array | null $fields = null ) : array
$query lithium\data\model\Query A Query instance.
$fields array | null Array of formatted fields.
리턴 array

_splitFieldname() 보호된 메소드

Return the alias and the field name from an identifier name.
protected _splitFieldname ( string $field ) : array
$field string Field name or identifier name.
리턴 array Returns an array with the alias (or `null` if not applicable) as first value and the field name as second value.

_toBoolean() 보호된 메소드

Casts a value which is being written or compared to a boolean-type database column.
protected _toBoolean ( mixed $value ) : boolean
$value mixed A value of unknown type to be cast to boolean. Numeric values not equal to zero evaluate to `true`, otherwise `false`. String values equal to `'true'`, `'t'` or `'T'` evaluate to `true`, all others to `false`. In all other cases, uses PHP's default casting.
리턴 boolean Returns a boolean representation of `$value`, based on the comparison rules specified above. Database adapters may override this method if boolean type coercion is required and falls outside the rules defined.

_updateFields() 보호된 메소드

Also handles correct incremented/decremented fields.
또한 보기: lithium\data\Entity::increment()
또한 보기: lithium\data\source\Database::_fieldsReturn()
protected _updateFields ( array $data, array $schema, object $context ) : string
$data array
$schema array An array defining the schema of the fields used in the criteria.
$context object Generally a `data\model\Query` instance.
리턴 string SQL fragment, with fields separated by comma.

alias() 공개 메소드

public alias ( $alias, $context )

applyStrategy() 공개 메소드

Applying a strategy to a lithium\data\model\Query object
public applyStrategy ( array $options, object $context )
$options array The option array
$context object A find query object to configure

calculation() 공개 메소드

Executes calculation-related queries, such as those required for count and other aggregates.
public calculation ( string $type, mixed $query, array $options = [] ) : integer | null
$type string Only accepts `count`.
$query mixed The query to be executed.
$options array Optional arguments for the `read()` query that will be executed to obtain the calculation result.
리턴 integer | null Result of the calculation or `null` if the calculation failed.

cast() 공개 메소드

public cast ( $entity, array $data, array $options = [] )
$data array
$options array

column() 공개 메소드

Generate a database-native column schema string
public column ( $field ) : string
리턴 string SQL string

comment() 공개 메소드

Adds formatting to SQL comments before they're embedded in queries.
public comment ( string $comment ) : string
$comment string
리턴 string

conditions() 공개 메소드

Conversion rules are as follows: - If $key is numeric and $value is a string, $value is treated as a literal SQL fragment and returned.
public conditions ( string | array $conditions, object $context, array $options = [] ) : string
$conditions string | array The conditions for this query.
$context object The current `lithium\data\model\Query` instance.
$options array Available options are: - `'prepend'` _boolean|string_: The string to prepend or `false` for no prepending. Defaults to `'WHERE'`.
리턴 string Returns the `WHERE` clause of an SQL query.

connect() 공개 메소드

Will set general options on the connection as provided (persistence, encoding).
또한 보기: lithium\data\source\Database::encoding()
public connect ( ) : boolean
리턴 boolean Returns `true` if a database connection could be established, otherwise `false`.

constraints() 공개 메소드

If the query constraints are defined as an array, key pairs are converted to SQL strings. If $key is numeric and $value is a string, $value is treated as a literal SQL fragment and returned.
public constraints ( string | array $constraints, Query $context, array $options = [] ) : string
$constraints string | array The constraints for a `ON` clause.
$context lithium\data\model\Query
$options array Available options are: - `'prepend'` _boolean|string_: The string to prepend or `false` for no prepending. Defaults to `'ON'`.
리턴 string Returns the `ON` clause of an SQL query.

create() 공개 메소드

Inserts a new record into the database based on a the Query. The record is updated with the id of the insert.
또한 보기: lithium\util\String::insert()
public create ( object $query, array $options = [] ) : boolean
$query object An SQL query string, or `lithium\data\model\Query` object instance.
$options array If $query is a string, $options contains an array of bind values to be escaped, quoted, and inserted into `$query` using `String::insert()`.
리턴 boolean Returns `true` if the query succeeded, otherwise `false`.

createSchema() 공개 메소드

Create a database-native schema
public createSchema ( string $source, object $schema ) : boolean
$source string A table name.
$schema object A `Schema` instance.
리턴 boolean `true` on success, `true` otherwise

delete() 공개 메소드

Deletes a record in the database based on the given Query.
public delete ( object $query, array $options = [] ) : boolean
$query object An SQL string, or `lithium\data\model\Query` object instance.
$options array If `$query` is a string, `$options` is the array of quoted/escaped parameter values to be inserted into the query.
리턴 boolean Returns `true` on successful query execution (not necessarily if records are deleted), otherwise `false`.

disconnect() 공개 메소드

Disconnects the adapter from the database.
public disconnect ( ) : boolean
리턴 boolean Returns `true` on success, else `false`.

dropSchema() 공개 메소드

Drops a table.
public dropSchema ( string $source, boolean $soft = true ) : boolean
$source string The table name to drop.
$soft boolean With "soft dropping", the function will retrun `true` even if the table doesn't exists.
리턴 boolean `true` on success, `false` otherwise

encoding() 추상적인 공개 메소드

Getter/Setter for the connection's encoding Abstract. Must be defined by child class.
abstract public encoding ( mixed $encoding = null ) : mixed.
$encoding mixed
리턴 mixed.

error() 추상적인 공개 메소드

Abstract. Must be defined by child class.
abstract public error ( )

fields() 공개 메소드

Returns a string of formatted fields to be inserted into the query statement.
public fields ( array $fields, object $context ) : string
$fields array Array of fields.
$context object Generally a `data\model\Query` instance.
리턴 string A SQL formatted string

group() 공개 메소드

Return formatted clause for GROUP BY with known fields escaped.
public group ( string | array $group, object $context ) : string | null
$group string | array The clause to be formatted.
$context object
리턴 string | null Formatted clause, `null` if there is nothing to format.

having() 공개 메소드

Conversion rules are as follows: - If $key is numeric and $value is a string, $value is treated as a literal SQL fragment and returned.
public having ( string | array $conditions, object $context, array $options = [] ) : string
$conditions string | array The havings for this query.
$context object The current `lithium\data\model\Query` instance.
$options array Available options are: - `'prepend'` _boolean|string_: The string to prepend or `false` for no prepending. Defaults to `'HAVING'`.
리턴 string Returns the `HAVING` clause of an SQL query.

join() 공개 메소드

Set a query's join according a Relationship.
public join ( object $context, object $rel, string $fromAlias = null, string $toAlias = null, mixed $constraints = [] )
$context object A Query instance
$rel object A Relationship instance
$fromAlias string Set a specific alias for the `'from'` `Model`.
$toAlias string Set a specific alias for `'to'` `Model`.
$constraints mixed If `$constraints` is an array, it will be merged to defaults constraints. If `$constraints` is an object, defaults won't be merged.

joins() 공개 메소드

Returns a join statement for given array of query objects
public joins ( array $joins, Query $context ) : string
$joins array A single or array of `lithium\data\model\Query` objects
$context lithium\data\model\Query
리턴 string

limit() 공개 메소드

Returns a LIMIT statement from the given limit and the offset of the context object.
public limit ( integer $limit, Query $context ) : string
$limit integer
$context lithium\data\model\Query
리턴 string

methods() 공개 메소드

Determines the set of methods to be used when exporting query values.
public methods ( ) : array
리턴 array

name() 공개 메소드

Field name handler to ensure proper escaping.
public name ( string $name ) : string
$name string Field or identifier name.
리턴 string Returns `$name` quoted according to the rules and quote characters of the database adapter subclass.

on() 공개 메소드

Build the ON constraints from a Relationship instance
public on ( object $rel, $aliasFrom = null, $aliasTo = null, array $constraints = [] ) : array
$rel object A Relationship instance
$constraints array Array of additionnal $constraints.
리턴 array A constraints array.

order() 공개 메소드

Return formatted clause for ORDER BY with known fields escaped and directions normalized to uppercase. When order direction is missing or unrecognized defaults to ASC.
public order ( string | array $order, object $context ) : string | null
$order string | array The clause to be formatted.
$context object
리턴 string | null Formatted clause, `null` if there is nothing to format.

read() 공개 메소드

Reads records from a database using a lithium\data\model\Query object or raw SQL string.
public read ( string | object $query, array $options = [] ) : mixed
$query string | object `lithium\data\model\Query` object or SQL string.
$options array If `$query` is a raw string, contains the values that will be escaped and quoted. Other options: - `'return'` _string_: switch return between `'array'`, `'item'`, or `'resource'` _string_: Defaults to `'item'`.
리턴 mixed Determined by `$options['return']`.

relationship() 공개 메소드

Defines or modifies the default settings of a relationship between two models.
public relationship ( string $class, string $type, string $name, array $config = [] ) : array
$class string the primary model of the relationship
$type string the type of the relationship (hasMany, hasOne, belongsTo)
$name string the name of the relationship
$config array relationship options
리턴 array Returns an array containing the configuration for a model relationship.

renderCommand() 공개 메소드

Returns a given type statement for the given data, rendered from Database::$_strings.
public renderCommand ( string $type, string $data = null, string $context = null ) : string
$type string One of `'create'`, `'read'`, `'update'`, `'delete'` or `'join'`.
$data string The data to replace in the string.
$context string
리턴 string

schema() 공개 메소드

Builds an array of keyed on the fully-namespaced Model with array of fields as values for the given Query
public schema ( Query $query, Result | null $resource = null, object | null $context = null ) : array
$query lithium\data\model\Query A Query instance.
$resource Result | null An optional a result resource.
$context object | null
리턴 array

update() 공개 메소드

Updates a record in the database based on the given Query.
public update ( object $query, array $options = [] ) : boolean
$query object A `lithium\data\model\Query` object
$options array none
리턴 boolean

value() 공개 메소드

Will bypass any formatters and casting - effectively forcing the engine "to keep its hands off" - when $value is an object with the property scalar (created by casting a scalar value to an object i.e. (object) 'foo'). This feature allows to construct values or queries that are not (yet) supported by the engine.
또한 보기: lithium\data\source\Database::schema()
public value ( mixed $value, array $schema = [] ) : mixed
$value mixed The value to be converted. Arrays will be recursively converted.
$schema array Formatted array from `lithium\data\source\Database::schema()`
리턴 mixed value with converted type

프로퍼티 상세

$_cachedNames 보호되어 있는 프로퍼티

Holds cached names.
protected array $_cachedNames
리턴 array

$_classes 보호되어 있는 프로퍼티

Classes used by Database.
protected array $_classes
리턴 array

$_columns 보호되어 있는 프로퍼티

The supported column types and their default values
protected array $_columns
리턴 array

$_constraintTypes 보호되어 있는 프로퍼티

protected $_constraintTypes

$_operators 보호되어 있는 프로퍼티

List of SQL operators, paired with handling options.
protected array $_operators
리턴 array

$_quotes 보호되어 있는 프로퍼티

A pair of opening/closing quote characters used for quoting identifiers in SQL queries.
protected array $_quotes
리턴 array

$_strategies 보호되어 있는 프로퍼티

Array of named callable objects representing different strategies for performing specific types of queries.
protected array $_strategies
리턴 array

$_strings 보호되어 있는 프로퍼티

Strings used to render the given statement
또한 보기: lithium\data\source\Database::renderCommand()
protected array $_strings
리턴 array

$connection 공개적으로 프로퍼티

Holds the current connection.
public PDO,PD $connection
리턴 PD\PDO