Trait TypeMapTrait
Trait TypeMapTrait
Property Summary
-
$_typeMap protected
Cake\Database\TypeMap|null
Method Summary
-
getDefaultTypes() public
Gets default types of current type map.
-
getTypeMap() public
Returns the existing type map.
-
setDefaultTypes() public
Overwrite the default type mappings for fields in the implementing object.
-
setTypeMap() public
Creates a new TypeMap if $typeMap is an array, otherwise exchanges it for the given one.
Method Detail
getDefaultTypes() ¶ public
getDefaultTypes(): array
Gets default types of current type map.
Returns
array
getTypeMap() ¶ public
getTypeMap(): Cake\Database\TypeMap
Returns the existing type map.
Returns
Cake\Database\TypeMap
setDefaultTypes() ¶ public
setDefaultTypes(array $types): $this
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(arrayCake\Database\TypeMap $typeMap): $this
Creates a new TypeMap if $typeMap is an array, otherwise exchanges it for the given one.
Parameters
-
arrayCake\Database\TypeMap
$typeMap Creates a TypeMap if array, otherwise sets the given TypeMap
Returns
$this