irm-1.6-b3/MDB/Common.php
/**
     * general type conversion method
     *
     * @param mixed $value refernce to a value to be converted
     * @param int $type constant that specifies which type to convert to
     * @return object a MDB error on failure
     * @access private
     */
general type conversion method
@param mixed $value refernce to a value to be converted
@param int $type constant that specifies which type to convert to
@return object a MDB error on failure
@access private
general type conversion method @param mixed $value refernce to a value to be converted @param int $type constant that specifies which type to convert to @return object a MDB error on failure @access private
function _baseConvertResult($value, $type)
    {
        switch ($type) {
            case MDB_TYPE_TEXT:
                return($value);
            case MDB_TYPE_BLOB:
                return($value);
            case MDB_TYPE_CLOB:
                return($value);
            case MDB_TYPE_INTEGER:
                return(intval($value));
            case MDB_TYPE_BOOLEAN:
                return ($value == 'Y') ? TRUE : FALSE;
            case MDB_TYPE_DECIMAL:
                return($value);
            case MDB_TYPE_FLOAT:
                return(doubleval($value));
            case MDB_TYPE_DATE:
                return($value);
            case MDB_TYPE_TIME:
                return($value);
            case MDB_TYPE_TIMESTAMP:
                return($value);
            case MDB_TYPE_CLOB:
                return($value);
            case MDB_TYPE_BLOB:
                return($this->raiseError(MDB_ERROR_INVALID, NULL, NULL,
                    'BaseConvertResult: attempt to convert result value to an unsupported type ' . $type));
            default:
                return($this->raiseError(MDB_ERROR_INVALID, NULL, NULL,
                    'BaseConvertResult: attempt to convert result value to an unknown type ' . $type));
        }
    }
function _baseConvertResult ( $ value , $ type ) { switch ( $ type ) { case MDB_TYPE_TEXT : return ( $ value ) ; case MDB_TYPE_BLOB : return ( $ value ) ; case MDB_TYPE_CLOB : return ( $ value ) ; case MDB_TYPE_INTEGER : return ( intval ( $ value ) ) ; case MDB_TYPE_BOOLEAN : return ( $ value == 'Y' ) ? TRUE : FALSE ; case MDB_TYPE_DECIMAL : return ( $ value ) ; case MDB_TYPE_FLOAT : return ( doubleval ( $ value ) ) ; case MDB_TYPE_DATE : return ( $ value ) ; case MDB_TYPE_TIME : return ( $ value ) ; case MDB_TYPE_TIMESTAMP : return ( $ value ) ; case MDB_TYPE_CLOB : return ( $ value ) ; case MDB_TYPE_BLOB : return ( $ this -> raiseError ( MDB_ERROR_INVALID , NULL , NULL , 'BaseConvertResult: attempt to convert result value to an unsupported type ' . $ type ) ) ; default : return ( $ this -> raiseError ( MDB_ERROR_INVALID , NULL , NULL , 'BaseConvertResult: attempt to convert result value to an unknown type ' . $ type ) ) ; } }
general type conversion method
 @param mixed $value refernce to a value to be converted
 @param int $type constant that specifies which type to convert to
 @return object a MDB error on failure
 @access private
general type conversion method @param mixed $value refernce to a value to be converted @param int $type constant that specifies which type to convert to @return object a MDB error on failure @access private