Class TSqlMapTypeHandler

Description

A simple interface for implementing custom type handlers.

Using this interface, you can implement a type handler that will perform customized processing before parameters are set on and after values are retrieved from the database. Using a custom type handler you can extend the framework to handle types that are not supported, or handle supported types in a different way. For example, you might use a custom type handler to implement proprietary BLOB support (e.g. Oracle), or you might use it to handle booleans using "Y" and "N" instead of the more typical 0/1.

  • abstract:
  • since: 3.1
  • version: $Id: TSqlMapTypeHandlerRegistry.php 1568 2006-12-09 09:17:22Z wei $
  • author: Wei Zhuo <weizho[at]gmail[dot]com>

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

TComponent
   |
   --TSqlMapTypeHandler
Method Summary
mixed createNewInstance ([array $row = null])
string getDbType ()
void getParameter (object The $object, object The 1)
mixed getResult (object The $string)
void getType ()
void setDbType (string $value)
void setType (mixed $value)
Methods
createNewInstance (line 190)

Casts the string representation of a value into a type recognized by

this type handler. This method is used to translate nullValue values into types that can be appropriately compared. If your custom type handler cannot support nullValues, or if there is no reasonable string representation for this type (e.g. File type), you can simply return the String representation as it was passed in. It is not recommended to return null, unless null was passed in.

  • abstract:
  • access: public
mixed createNewInstance ([array $row = null])
  • array $row: result row.
getDbType (line 143)
  • return: database field type.
  • access: public
string getDbType ()
getParameter (line 167)

Performs processing on a value before it is used to set the parameter of a IDbCommand.

  • abstract:
  • access: public
void getParameter (object The $object, object The 1)
  • object The 1: value to be set.
  • object The $object: interface for setting the value.
getResult (line 176)

Performs processing on a value before after it has been retrieved

from a database

  • return: The processed value.
  • abstract:
  • access: public
mixed getResult (object The $string)
  • object The $string: interface for getting the value.
getType (line 148)
  • access: public
void getType ()
setDbType (line 135)
  • access: public
void setDbType (string $value)
  • string $value: database field type.
setType (line 156)
  • access: public
void setType (mixed $value)

Inherited Methods

Inherited From TComponent

TComponent::addParsedObject()
TComponent::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
TComponent::createdOnTemplate()
TComponent::detachEventHandler()
TComponent::evaluateExpression()
TComponent::evaluateStatements()
TComponent::getEventHandlers()
TComponent::getSubProperty()
TComponent::hasEvent()
TComponent::hasEventHandler()
TComponent::hasProperty()
TComponent::raiseEvent()
TComponent::setSubProperty()
TComponent::__get()
TComponent::__set()

Documentation generated on Mon, 21 Apr 2008 11:36:19 -0400 by phpDocumentor 1.3.0RC4