Implements default and single-use mappings for columns to their associated types
__construct( array $defaults [] )
Creates an instance with the given defaults
$defaults
optional [] addDefaults( array $types )
Add additional default types into the type map.
If a key already exists it will not be overwritten.
$types
defaults( array $defaults null )
Configures a map of default fields and their associated types to be used as the default list of types for every function in this class with a $types param. Useful to avoid repetition when calling the same functions using the same fields and types.
If called with no arguments it will return the currently configured types.
$query->defaults(['created' => 'datetime', 'is_visible' => 'boolean']);
This method will replace all the existing type maps with the ones provided.
$defaults
optional null mixed
type( string $column )
Returns the type of the given column. If there is no single use type is configured, the column type will be looked for inside the default mapping. If neither exist, null will be returned.
$column
null|string
types( array $types null )
Sets a map of fields and their associated types for single-use.
If called with no arguments it will return the currently configured types.
$query->types(['created' => 'time']);
This method will replace all the existing type maps with the ones provided.
$types
optional null mixed
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
http://api.cakephp.org/3.1/class-Cake.Database.TypeMap.html