## Class TSqlMapTypeHandlerRegistry

Description

TTypeHandlerFactory provides type handler classes to convert database field type to PHP types and vice versa.

- since: 3.1
- version: $Id: TSqlMapTypeHandlerRegistry.php 2541 2008-10-21 15:05:13Z qiang.xue $
- author: Wei Zhuo <weizho[at]gmail[dot]com>

Located in /Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php (line 22)

Method Summary
mixed convertToType (string $type, mixed $value)
mixed createInstanceOf ([string $type = ''])
TSqlMapTypeHandler getDbTypeHandler ([string $dbType = 'NULL'])
TSqlMapTypeHandler getTypeHandler (string $class)
void registerTypeHandler (TSqlMapTypeHandler $handler)
Methods
convertToType (line 90)

Converts the value to given type using PHP's settype() function.

- return: type casted value.
- access: public

mixed convertToType (string $type, mixed $value)

- string $type: PHP primative type.
- mixed $value: value to be casted

createInstanceOf (line 62)

Creates a new instance of a particular class (for PHP primative types, their corresponding default value for given type is used).

- return: default type value, if no type is specified null is returned.
- access: public
- throws: TSqlMapException if class name is not found.

mixed createInstanceOf ([string $type = ''])

- string $type: PHP type name

getDbTypeHandler (line 30)

- return: type handler for give database field type.
- access: public

TSqlMapTypeHandler getDbTypeHandler ([string $dbType = 'NULL'])

- string $dbType: database field type

getTypeHandler (line 41)

- return: type handler
- access: public

TSqlMapTypeHandler getTypeHandler (string $class)

- string $class: type handler class name

registerTypeHandler (line 50)

- access: public

void registerTypeHandler (TSqlMapTypeHandler $handler)

- TSqlMapTypeHandler $handler: registers a new type handler

Documentation generated on Mon, 22 Feb 2010 12:18:44 +0000 by phpDocumentor 1.3.0RC4