Trait TypeMapTrait
Trait TypeMapTrait
Property Summary
- 
        $_typeMap protectedCake\Database\TypeMap|null
Method Summary
- 
          getDefaultTypes() publicGets default types of current type map. 
- 
          getTypeMap() publicReturns the existing type map. 
- 
          setDefaultTypes() publicOverwrite 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. 
Method Detail
getDefaultTypes() ¶ public
getDefaultTypes(): array<int|string, string>Gets default types of current type map.
Returns
array<int|string, string>getTypeMap() ¶ public
getTypeMap(): Cake\Database\TypeMapReturns the existing type map.
Returns
Cake\Database\TypeMapsetDefaultTypes() ¶ public
setDefaultTypes(array<int|string, string> $types): $thisOverwrite 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<int|string, string>$types
- The array of types to set. 
Returns
$thisSee Also
setTypeMap() ¶ public
setTypeMap(Cake\Database\TypeMap|array<int|string, string> $typeMap): $thisCreates a new TypeMap if $typeMap is an array, otherwise exchanges it for the given one.
Parameters
- 
                Cake\Database\TypeMap|array<int|string, string>$typeMap
- Creates a TypeMap if array, otherwise sets the given TypeMap 
Returns
$this