diff options
Diffstat (limited to 'framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php')
-rw-r--r-- | framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php | 85 |
1 files changed, 1 insertions, 84 deletions
diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php b/framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php index 18b8ef99..f6a22ee1 100644 --- a/framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php +++ b/framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php @@ -103,87 +103,4 @@ class TSqlMapTypeHandlerRegistry settype($value, $type); return $value; } -} - -/** - * 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. - * - * @author Wei Zhuo <weizho[at]gmail[dot]com> - * @package System.Data.SqlMap - * @since 3.1 - */ -abstract class TSqlMapTypeHandler extends TComponent -{ - private $_dbType='NULL'; - private $_type; - /** - * @param string database field type. - */ - public function setDbType($value) - { - $this->_dbType=$value; - } - - /** - * @return string database field type. - */ - public function getDbType() - { - return $this->_dbType; - } - - public function getType() - { - if($this->_type===null) - return get_class($this); - else - return $this->_type; - } - - public function setType($value) - { - $this->_type=$value; - } - - /** - * Performs processing on a value before it is used to set - * the parameter of a IDbCommand. - * @param object The interface for setting the value. - * @param object The value to be set. - */ - public abstract function getParameter($object); - - - /** - * Performs processing on a value before after it has been retrieved - * from a database - * @param object The interface for getting the value. - * @return mixed The processed value. - */ - public abstract function getResult($string); - - - /** - * 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. - * @param array result row. - * @return mixed - */ - public abstract function createNewInstance($row=null); -} - +}
\ No newline at end of file |