Fr3nch13/CakePHP Utilities

TypeMapTrait

Trait TypeMapTrait

Table of Contents

Properties

$_typeMap  : TypeMap|null

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

Methods

getDefaultTypes()

Gets default types of current type map.

public getDefaultTypes() : array<int|string, string>
Return values
array<int|string, string>

setDefaultTypes()

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
see
TypeMap::setDefaults()
Return values
$this

setTypeMap()

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

Return values
$this

        
On this page

Search results