$_typeMap
$_typeMap : \Cake\Database\TypeMap
An expression object to contain values being inserted.
Helps generate SQL with the correct number of placeholders and bind values correctly into the statement.
$_typeMap : \Cake\Database\TypeMap
$_query : \Cake\Database\Query|null
The Query object to use as a values expression
setTypeMap(array|\Cake\Database\TypeMap $typeMap) : $this
Creates a new TypeMap if $typeMap is an array, otherwise exchanges it for the given one.
array|\Cake\Database\TypeMap | $typeMap | Creates a TypeMap if array, otherwise sets the given TypeMap |
getTypeMap() : \Cake\Database\TypeMap
Returns the existing type map.
typeMap(array|\Cake\Database\TypeMap|null $typeMap = null) : $this|\Cake\Database\TypeMap
Creates a new TypeMap if $typeMap is an array, otherwise returns the existing type map or exchanges it for the given one.
array|\Cake\Database\TypeMap|null | $typeMap | Creates a TypeMap if array, otherwise sets the given TypeMap |
setDefaultTypes(array $types) : $this
Allows setting default types when chaining query.
array | $types | The array of types to set. |
None found |
None found |
defaultTypes(array|null $types = null) : $this|array
Allows setting default types when chaining query
array|null | $types | The array of types to set. |
None found |
__construct(array $columns, \Cake\Database\TypeMap $typeMap)
Constructor
array | $columns | The list of columns that are going to be part of the values. |
\Cake\Database\TypeMap | $typeMap | A dictionary of column -> type names |
None found |
add(array|\Cake\Database\Query $data) : void
Add a row of data to be inserted.
array|\Cake\Database\Query | $data | Array of data to append into the insert, or a query for doing INSERT INTO .. SELECT style commands |
When mixing array + Query data types.
None found |
setColumns(array $cols) : $this
Sets the columns to be inserted.
array | $cols | Array with columns to be inserted. |
None found |
None found |
columns(array|null $cols = null) : array|$this
Sets the columns to be inserted. If no params are passed, then it returns the currently stored columns.
array|null | $cols | Array with columns to be inserted. |
None found |
setValues(array $values) : $this
Sets the values to be inserted.
array | $values | Array with values to be inserted. |
None found |
None found |
values(array|null $values = null) : array|$this
Sets the values to be inserted. If no params are passed, then it returns the currently stored values
array|null | $values | Array with values to be inserted. |
None found |
setQuery(\Cake\Database\Query $query) : $this
Sets the query object to be used as the values expression to be evaluated to insert records in the table.
\Cake\Database\Query | $query | The query to set |
None found |
getQuery() : \Cake\Database\Query|null
Gets the query object to be used as the values expression to be evaluated to insert records in the table.
None found |
query(\Cake\Database\Query|null $query = null) : \Cake\Database\Query|null|$this
Sets the query object to be used as the values expression to be evaluated to insert records in the table. If no params are passed, then it returns the currently stored query
\Cake\Database\Query|null | $query | The query to set |
None found |
sql(\Cake\Database\ValueBinder $generator) : string
Convert the values into a SQL string with placeholders.
\Cake\Database\ValueBinder | $generator | Placeholder generator object |
None found |
traverse(callable $visitor) : void
Traverse the values expression.
This method will also traverse any queries that are to be used in the INSERT values.
callable | $visitor | The visitor to traverse the expression with. |
None found |
_castToExpression(mixed $value, string $type) : mixed
Conditionally converts the passed value to an ExpressionInterface object if the type class implements the ExpressionTypeInterface. Otherwise, returns the value unmodified.
mixed | $value | The value to converto to ExpressionInterface |
string | $type | The type name |
None found |
_requiresToExpressionCasting(array $types) : array
Returns an array with the types that require values to be casted to expressions, out of the list of type names passed as parameter.
array | $types | List of type names |
None found |
_columnNames() : array
Get the bare column names.
Because column names could be identifier quoted, we need to strip the identifiers off of the columns.
None found |
_processExpressions() : void
Converts values that need to be casted to expressions
None found |