Trait TypeMapTrait
Trait TypeMapTrait
Properties summary
- $_typeMap protected
\Cake\Database\TypeMap
Method Summary
- setTypeMap() public
Creates a new TypeMap if $typeMap is an array, otherwise exchanges it for the given one.
- typeMap() public
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() public
defaultTypes(array $types)
Allows setting default types when chaining query
Parameters
-
array|null
$types optional The array of types to set.
Returns
$this|array
getDefaultTypes() public
getDefaultTypes()
Gets default types of current type map.
Returns
array
getTypeMap() public
getTypeMap()
Returns the existing type map.
Returns
\Cake\Database\TypeMap
setDefaultTypes() 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 Also
setTypeMap() public
setTypeMap(mixed $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() public
typeMap(mixed $typeMap)
Creates a new TypeMap if $typeMap is an array, otherwise returns the existing type map or exchanges it for the given one.
Parameters
-
array|\Cake\Database\TypeMap|null
$typeMap optional Creates a TypeMap if array, otherwise sets the given TypeMap
Returns
$this|\Cake\Database\TypeMap
Property Detail
$_typeMap protected
Type
\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.9/trait-Cake.Database.TypeMapTrait.html