Class TSqlMapTypeHandler
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.
Method Summary |
abstract
mixed
|
Casts the string representation of a value into a type recognized by
|
string
|
|
abstract
void
|
Performs processing on a value before it is used to set the parameter of a IDbCommand.
|
abstract
mixed
|
Performs processing on a value before after it has been retrieved
|
void
|
|
void
|
|
void
|
|
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()
|
Method Details |
createNewInstance
public abstract mixed createNewInstance |
(array $row ) |
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.
Input |
array | $row | result row. |
Output |
Exception |
|
getDbType
public string getDbType |
() |
Output |
string
| database field type. |
Exception |
|
getParameter
public abstract void getParameter |
(object The $object , object The 1 ) |
Performs processing on a value before it is used to set the parameter of a IDbCommand.
Input |
object The | $object | interface for setting the value. |
object The | 1 | value to be set. |
Output |
Exception |
|
getResult
public abstract mixed getResult |
(object The $string ) |
Performs processing on a value before after it has been retrieved
from a database
Input |
object The | $string | interface for getting the value. |
Output |
mixed
| The processed value. |
Exception |
|
getType
|
setDbType
public void setDbType |
(string $value ) |
Input |
string | $value | database field type. |
Output |
Exception |
|
setType
public void setType |
(mixed $value ) |
Input |
mixed | $value | |
Output |
Exception |
|
|