Trait TypeMapTrait
Trait TypeMapTrait
Direct Users
- Cake\Database\Expression\QueryExpression
- Cake\Database\Expression\ValuesExpression
- Cake\Database\Query
Indirect Users
- Cake\Database\Expression\FunctionExpression
- Cake\Database\Expression\OrderByExpression
- Cake\ORM\Query
Properties summary
-
$_typeMap
protected
Method Summary
- Allows setting default types when chaining query
- getDefaultTypes() publicGets default types of current type map.
- getTypeMap() publicReturns the existing type map.
- setDefaultTypes() public
Overwrite the default type mappings for fields in the implementing object.
- setTypeMap() publicCreates a new TypeMap if $typeMap is an array, otherwise exchanges it for the given one.
-
Creates a new TypeMap if $typeMap is an array, otherwise returns the existing type map or exchanges it for the given one.
Method Detail
defaultTypes()source public deprecated
defaultTypes( array $types = null )
Allows setting default types when chaining query
Deprecated
3.4.0 Use setDefaultTypes()/getDefaultTypes() instead.Parameters
- array
$types
optional null - The array of types to set.
Returns
$this|array
getDefaultTypes()source public
getDefaultTypes( )
Gets default types of current type map.
Returns
arraygetTypeMap()source public
getTypeMap( )
Returns the existing type map.
Returns
Cake\Database\TypeMap
setDefaultTypes()source public
setDefaultTypes( array $types )
Overwrite the default type mappings for fields in the implementing object.
This method is useful if you need to set type mappings that are shared across multiple functions/expressions in a query.
To add a default without overwriting existing ones use getTypeMap()->addDefaults()
Parameters
- array
$types
- The array of types to set.
Returns
$this
See
\Cake\Database\TypeMap::setDefaults()setTypeMap()source public
setTypeMap( array|Cake\Database\TypeMap $typeMap )
Creates a new TypeMap if $typeMap is an array, otherwise exchanges it for the given one.
Parameters
- array|
Cake\Database\TypeMap
$typeMap
- Creates a TypeMap if array, otherwise sets the given TypeMap
Returns
$this
typeMap()source public deprecated
typeMap( array|Cake\Database\TypeMap|null $typeMap = null )
Creates a new TypeMap if $typeMap is an array, otherwise returns the existing type map or exchanges it for the given one.
Deprecated
3.4.0 Use setTypeMap()/getTypeMap() instead.Parameters
- array|
Cake\Database\TypeMap
|null$typeMap
optional null - Creates a TypeMap if array, otherwise sets the given TypeMap
Returns
$this|\Cake\Database\TypeMap
Properties detail
$_typeMapsource
protected Cake\Database\TypeMap
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.7/class-Cake.Database.TypeMapTrait.html