Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml


Classes:
Keyword

Class TSqlMapTypeHandlerRegistry


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

Since: 3.1
Author: Wei Zhuo <weizho[at]gmail[dot]com>

Method Summary
mixed
convertToType ( string $type, mixed $value)
Converts the value to given type using PHP's settype() function.
mixed
createInstanceOf ( string $type)
Creates a new instance of a particular class (for PHP primative types, their corresponding default value for given type is used).
TSqlMapTypeHandler
getDbTypeHandler ( string $dbType)
TSqlMapTypeHandler
getTypeHandler ( string $class)
void
registerTypeHandler ( TSqlMapTypeHandler $handler)

Method Details

convertToType

public mixed convertToType (string $type , mixed $value )

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

Input
string$typePHP primative type.
mixed$valuevalue to be casted
Output
mixed type casted value.
Exception

createInstanceOf

public mixed createInstanceOf (string $type )

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

Input
string$typePHP type name
Output
mixed default type value, if no type is specified null is returned.
Exception
throwsTSqlMapException if class name is not found.

getDbTypeHandler

public TSqlMapTypeHandler getDbTypeHandler (string $dbType )

Input
string$dbTypedatabase field type
Output
TSqlMapTypeHandler type handler for give database field type.
Exception

getTypeHandler

public TSqlMapTypeHandler getTypeHandler (string $class )

Input
string$classtype handler class name
Output
TSqlMapTypeHandler type handler
Exception

registerTypeHandler

public void registerTypeHandler (TSqlMapTypeHandler $handler )

Input
TSqlMapTypeHandler$handlerregisters a new type handler
Output
Exception