\Cake\DatabaseTypeConverterTrait

Type converter trait

Summary

Methods
Properties
Constants
cast()
matchTypes()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

cast()

cast(mixed  $value, \Cake\Database\Type|string  $type) : array

Converts a give value to a suitable database value based on type and return relevant internal statement type

Parameters

mixed $value

The value to cast

\Cake\Database\Type|string $type

The type name or type instance to use.

Returns

array —

list containing converted value and internal type

matchTypes()

matchTypes(array  $columns, array  $types) : array

Matches columns to corresponding types

Both $columns and $types should either be numeric based or string key based at the same time.

Parameters

array $columns

list or associative array of columns and parameters to be bound with types

array $types

list or associative array of types

Returns

array