TypeMapTrait
Trait TypeMapTrait
Table of Contents
Properties
Methods
- getDefaultTypes() : array<int|string, string>
- Gets default types of current type map.
- getTypeMap() : TypeMap
- Returns the existing type map.
- setDefaultTypes() : $this
- Overwrite the default type mappings for fields in the implementing object.
- setTypeMap() : $this
- Creates a new TypeMap if $typeMap is an array, otherwise exchanges it for the given one.
Properties
$_typeMap
protected
TypeMap|null
$_typeMap
Methods
getDefaultTypes()
Gets default types of current type map.
public
getDefaultTypes() : array<int|string, string>
Return values
array<int|string, string>getTypeMap()
Returns the existing type map.
public
getTypeMap() : TypeMap
Return values
TypeMapsetDefaultTypes()
Overwrite the default type mappings for fields in the implementing object.
public
setDefaultTypes(array<int|string, string> $types) : $this
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
- $types : array<int|string, string>
-
The array of types to set.
Tags
Return values
$thissetTypeMap()
Creates a new TypeMap if $typeMap is an array, otherwise exchanges it for the given one.
public
setTypeMap(TypeMap|array<string|int, mixed> $typeMap) : $this
Parameters
- $typeMap : TypeMap|array<string|int, mixed>
-
Creates a TypeMap if array, otherwise sets the given TypeMap