Returns the variable type corresponding to the database column type
@param string $strDbType
@return string
@throws \Exception
766121
protected function variableTypeFromDbType($strDbType)
    {
        switch ($strDbType) {
            case Database\FieldType::BIT:
                return Type::BOOLEAN;
            case Database\FieldType::BLOB:
                return Type::STRING;
            case Database\FieldType::CHAR:
                return Type::STRING;
            case Database\FieldType::DATE:
                return Type::DATE_TIME;
            case Database\FieldType::DATE_TIME:
                return Type::DATE_TIME;
            case Database\FieldType::FLOAT:
                return Type::FLOAT;
            case Database\FieldType::INTEGER:
                return Type::INTEGER;
            case Database\FieldType::TIME:
                return Type::DATE_TIME;
            case Database\FieldType::VAR_CHAR:
                return Type::STRING;
            case Database\FieldType::JSON:
                return Type::STRING;
            default:
                throw new \Exception("Invalid Db Type to Convert: $strDbType");
        }
    }
76232
protected function getTypeByCode($type)
    {
        switch ($type) {
            case self::BOOLEAN:
                return 'boolean';
            case self::INT:
                return 'int';
            case self::FLOAT:
                return 'float';
            case self::STRING:
                return 'string';
            case self::DATE:
                return 'date';
            case self::OBJECT:
                return 'object';
            case self::XML:
                return 'xml';
            case self::DATA:
                return 'data';
            case self::DATA_ARRAY:
                return 'array';

            default:
                return null;
        }
    }
791904
public function entityGetAttrType($demAttrType)
    {
        $result = MageType::COL_TEXT;
        $type = key($demAttrType);
        $typeData = reset($demAttrType);
        switch ($type) {
            case DemType::ATTR_BINARY:
                $result = MageType::COL_BLOB;
                break;
            case DemType::ATTR_BOOLEAN:
                $result = MageType::COL_BOOLEAN;
                break;
            case DemType::ATTR_DATETIME:
                $result = MageType::COL_TIMESTAMP;
                break;
            case DemType::ATTR_INTEGER:
                $result = MageType::COL_INTEGER;
                if (isset($typeData[Cfg::SUBTYPE])) {
                    if ($typeData[Cfg::SUBTYPE] == DemType::ATTRSUB_SMALL_INT) {
                        $result = MageType::COL_SMALLINT;
                    }
                }
                break;
            case DemType::ATTR_NUMERIC:
                $result = MageType::COL_DECIMAL;
                break;
            case DemType::ATTR_OPTION:
                $result = MageType::COL_TEXT;
                break;
            case DemType::ATTR_TEXT:
                $result = MageType::COL_TEXT;
                break;
        }
        return $result;
    }
641568
public static int toSQLType(String strType) throws DatabaseException {
	strType = strType.toUpperCase().trim();
	if (strType.startsWith("CF_SQL_")) strType = strType.substring(7);
	if (strType.startsWith("SQL_")) strType = strType.substring(4);

	if (strType.length() > 2) {
	    char first = strType.charAt(0);
	    if (first == 'A') {
		if (strType.equals("ARRAY")) return Types.ARRAY;
	    }
	    else if (first == 'B') {
		if (strType.equals("BIGINT")) return Types.BIGINT;
		else if (strType.equals("BINARY")) return Types.BINARY;
		else if (strType.equals("BIT")) return Types.BIT;
		else if (strType.equals("BLOB")) return Types.BLOB;
		else if (strType.equals("BOOLEAN")) return Types.BOOLEAN;
		else if (strType.equals("BOOL")) return Types.BOOLEAN;
	    }
	    else if (first == 'C') {
		if (strType.equals("CLOB")) return Types.CLOB;
		else if (strType.equals("CHAR")) return Types.CHAR;
		else if (strType.equals("CLOB")) return Types.CLOB;
		else if (strType.equals("CURSOR")) return CFTypes.CURSOR;
	    }
	    else if (first == 'D') {
		if (strType.equals("DATALINK")) return Types.DATALINK;
		else if (strType.equals("DATE")) return Types.DATE;
		else if (strType.equals("DISTINCT")) return Types.DISTINCT;
		else if (strType.equals("DECIMAL")) return Types.DECIMAL;
		else if (strType.equals("DOUBLE")) return Types.DOUBLE;
	    }
	    else if (first == 'F') {
		if (strType.equals("FLOAT")) return Types.FLOAT;
	    }
	    else if (first == 'I') {
		if (strType.equals("IDSTAMP")) return CFTypes.IDSTAMP;
		else if (strType.equals("INTEGER")) return Types.INTEGER;
		else if (strType.equals("INT")) return Types.INTEGER;
	    }
	    else if (first == 'L') {
		// if(strType.equals("LONG"))return Types.INTEGER;
		if (strType.equals("LONGVARBINARY")) return Types.LONGVARBINARY;
		else if (strType.equals("LONGVARCHAR")) return Types.LONGVARCHAR;
	    }
	    else if (first == 'M') {
		if (strType.equals("MONEY")) return Types.DOUBLE;
		else if (strType.equals("MONEY4")) return Types.DOUBLE;
	    }
	    else if (first == 'N') {
		if (strType.equals("NUMERIC")) return Types.NUMERIC;
		else if (strType.equals("NUMBER")) return Types.NUMERIC;
		else if (strType.equals("NULL")) return Types.NULL;
		else if (strType.equals("NCHAR")) return Types.NCHAR;
		else if (strType.equals("NCLOB")) return Types.NCLOB;
		else if (strType.equals("NVARCHAR")) return Types.NVARCHAR;

	    }
	    else if (first == 'O') {
		if (strType.equals("OTHER")) return Types.OTHER;
		else if ("OBJECT".equals(strType)) return Types.OTHER;
	    }
	    else if (first == 'R') {
		if (strType.equals("REAL")) return Types.REAL;
		else if (strType.equals("REF")) return Types.REF;
		else if (strType.equals("REFCURSOR")) return CFTypes.CURSOR;
	    }
	    else if (first == 'S') {
		if (strType.equals("SMALLINT")) return Types.SMALLINT;
		else if (strType.equals("STRUCT")) return Types.STRUCT;
		else if (strType.equals("STRING")) return Types.VARCHAR;
		else if (strType.equals("SQLXML")) return Types.SQLXML;
	    }
	    else if (first == 'T') {
		if (strType.equals("TIME")) return Types.TIME;
		else if (strType.equals("TIMESTAMP")) return Types.TIMESTAMP;
		else if (strType.equals("TINYINT")) return Types.TINYINT;
	    }
	    else if (first == 'V') {
		if (strType.equals("VARBINARY")) return Types.VARBINARY;
		else if (strType.equals("VARCHAR")) return Types.VARCHAR;
		else if (strType.equals("VARCHAR2")) return CFTypes.VARCHAR2;
	    }
	}

	throw new DatabaseException("invalid CF SQL Type [" + strType + "]", null, null, null);
    }
1054216
public function getDatabaseType()
    {
        $reflClass = new \ReflectionClass($this);
        $clazz = $reflClass->getShortName();
        $pos = strpos($clazz, 'Platform');

        return strtolower(substr($clazz, 0, $pos));
    }
506735
public function getPhinxType($sqlTypeDef)
    {
        if (!preg_match('/^([\w]+)(\(([\d]+)*(,([\d]+))*\))*$/', $sqlTypeDef, $matches)) {
            throw new UnsupportedColumnTypeException('Column type "' . $sqlTypeDef . '" is not supported by SQLite.');
        } else {
            $limit = null;
            $scale = null;
            $type = $matches[1];
            if (count($matches) > 2) {
                $limit = $matches[3] ?: null;
            }
            if (count($matches) > 4) {
                $scale = $matches[5];
            }
            switch ($type) {
                case 'varchar':
                    $type = static::PHINX_TYPE_STRING;
                    if ($limit === 255) {
                        $limit = null;
                    }
                    break;
                case 'char':
                    $type = static::PHINX_TYPE_CHAR;
                    if ($limit === 255) {
                        $limit = null;
                    }
                    if ($limit === 36) {
                        $type = static::PHINX_TYPE_UUID;
                    }
                    break;
                case 'smallint':
                    $type = static::PHINX_TYPE_SMALL_INTEGER;
                    if ($limit === 11) {
                        $limit = null;
                    }
                    break;
                case 'int':
                    $type = static::PHINX_TYPE_INTEGER;
                    if ($limit === 11) {
                        $limit = null;
                    }
                    break;
                case 'bigint':
                    if ($limit === 11) {
                        $limit = null;
                    }
                    $type = static::PHINX_TYPE_BIG_INTEGER;
                    break;
                case 'blob':
                    $type = static::PHINX_TYPE_BINARY;
                    break;
            }
            if ($type === 'tinyint') {
                if ($matches[3] === 1) {
                    $type = static::PHINX_TYPE_BOOLEAN;
                    $limit = null;
                }
            }

            try {
                // Call this to check if parsed type is supported.
                $this->getSqlType($type);
            } catch (UnsupportedColumnTypeException $e) {
                $type = Literal::from($type);
            }

            return [
                'name' => $type,
                'limit' => $limit,
                'scale' => $scale
            ];
        }
    }
702219
public function getFrameType($type)
    {
        if (is_int($type)) {
            return $type;
        }
        if ($type === null) {
            $type = 'STRING';
        }
        $frametype = @constant(get_class($this) . '::' . $type);
        if ($frametype === null) {
            Daemon::log(__METHOD__ . ' : Undefined frametype "' . $type . '"');
        }
        return $frametype;
    }
17684
public function getPhinxType($sqlTypeDef)
    {
        if (!preg_match('/^([\w]+)(\(([\d]+)*(,([\d]+))*\))*$/', $sqlTypeDef, $matches)) {
            throw new \RuntimeException('Column type ' . $sqlTypeDef . ' is not supported');
        }

        $limit = null;
        $precision = null;
        $type = $matches[1];
        if (count($matches) > 2) {
            $limit = $matches[3] ?: null;
        }
        if (count($matches) > 4) {
            $precision = $matches[5];
        }
        switch ($matches[1]) {
            case 'varchar':
                $type = static::PHINX_TYPE_STRING;
                if ($limit === 255) {
                    $limit = null;
                }
                break;
            case 'char':
                $type = static::PHINX_TYPE_CHAR;
                if ($limit === 255) {
                    $limit = null;
                }
                if ($limit === 36) {
                    $type = static::PHINX_TYPE_UUID;
                }
                break;
            case 'int':
                $type = static::PHINX_TYPE_INTEGER;
                if ($limit === 11) {
                    $limit = null;
                }
                break;
            case 'bigint':
                if ($limit === 11) {
                    $limit = null;
                }
                $type = static::PHINX_TYPE_BIG_INTEGER;
                break;
            case 'blob':
                $type = static::PHINX_TYPE_BINARY;
                break;
        }
        if ($type === 'tinyint') {
            if ($matches[3] === 1) {
                $type = static::PHINX_TYPE_BOOLEAN;
                $limit = null;
            }
        }

        $this->getSqlType($type);

        return [
            'name' => $type,
            'limit' => $limit,
            'precision' => $precision,
        ];
    }
323745
public function getPDOParamType($phpType)
    {
        switch ($phpType) {
            case 'boolean':
                return PDO::PARAM_BOOL;
            case 'NULL':
                return PDO::PARAM_NULL;
            case 'integer':
                return PDO::PARAM_INT;
            case 'object': // Allowed if the object or resource has a __toString method
            case 'resource':
            case 'float': // Not actually returnable from get_type
            case 'double':
            case 'string':
                return PDO::PARAM_STR;
            case 'blob':
                return PDO::PARAM_LOB;
            case 'array':
            case 'unknown type':
            default:
                throw new InvalidArgumentException("Cannot bind parameter as it is an unsupported type ($phpType)");
        }
    }
694060
protected function _getMethodNameForType($type = null) {
		$result = '_getValueForString';
		if (empty($type)) {
			return $result;
		}

		$type = mb_strtolower($type);
		$methodName = '_getValueFor' . Inflector::camelize($type);
		if (method_exists($this, $methodName)) {
			$result = $methodName;
		}

		return $result;
	}
258151
public function getDbFieldType() : string
    {
        $dbFieldType = $this->config->getProvider('dbFieldType');
        $dbFieldType = new $dbFieldType($this->config);
        $dbFieldType = $dbFieldType->provide();

        return $dbFieldType;
    }
63515
public function getPhinxType($sqlType)
    {
        switch ($sqlType) {
            case 'nvarchar':
            case 'varchar':
                return static::PHINX_TYPE_STRING;
            case 'char':
            case 'nchar':
                return static::PHINX_TYPE_CHAR;
            case 'text':
            case 'ntext':
                return static::PHINX_TYPE_TEXT;
            case 'int':
            case 'integer':
                return static::PHINX_TYPE_INTEGER;
            case 'decimal':
            case 'numeric':
            case 'money':
                return static::PHINX_TYPE_DECIMAL;
            case 'bigint':
                return static::PHINX_TYPE_BIG_INTEGER;
            case 'real':
            case 'float':
                return static::PHINX_TYPE_FLOAT;
            case 'binary':
            case 'image':
            case 'varbinary':
                return static::PHINX_TYPE_BINARY;
            case 'time':
                return static::PHINX_TYPE_TIME;
            case 'date':
                return static::PHINX_TYPE_DATE;
            case 'datetime':
            case 'timestamp':
                return static::PHINX_TYPE_DATETIME;
            case 'bit':
                return static::PHINX_TYPE_BOOLEAN;
            case 'uniqueidentifier':
                return static::PHINX_TYPE_UUID;
            case 'filestream':
                return static::PHINX_TYPE_FILESTREAM;
            default:
                throw new \RuntimeException('The SqlServer type: "' . $sqlType . '" is not supported');
        }
    }
142748
public function getPhpType()
    {
        if (isset(self::$_phpTypesByProtobufType[$this->getType()])) {
            return self::$_phpTypesByProtobufType[$this->getType()];
        } else {
            return null;
        }
    }
1276520
public static int getJDBCTypeCode(int type) {

        switch (type) {

            case Types.SQL_BLOB :
                return Types.BLOB;

            case Types.SQL_CLOB :
                return Types.CLOB;

            case Types.SQL_BIGINT :
                return Types.BIGINT;

            case Types.SQL_BINARY :
                return Types.BINARY;

            case Types.SQL_VARBINARY :
                return Types.VARBINARY;

            case Types.SQL_BIT :
            case Types.SQL_BIT_VARYING :
                return Types.BIT;

            default :
                return type;
        }
    }
226466
def _get_dbal_column_type(self, type_):
        
        type_ = type_.lower()

        if type_ == "enum":
            return "string"

        return super(SQLiteSchemaGrammar, self)._get_dbal_column_type(type_)
862421
public function entityGetAttrSize($demAttrType)
    {
        $result = null;
        $type = key($demAttrType);
        $typeData = reset($demAttrType);
        switch ($type) {
            case DemType::ATTR_BINARY:
                break;
            case DemType::ATTR_BOOLEAN:
                break;
            case DemType::ATTR_DATETIME:
                break;
            case DemType::ATTR_INTEGER:
                $result = isset($typeData[Cfg::LENGTH]) ? $typeData[Cfg::LENGTH] : null;
                break;
            case DemType::ATTR_NUMERIC:
                if (isset($typeData[Cfg::PRECISION])) {
                    /* we should have 2 elements in the result array*/
                    $result = [MageType::OPT_PRECISION => 10, MageType::OPT_SCALE => 0];
                    $result[MageType::OPT_PRECISION] = $typeData[Cfg::PRECISION];
                    if (isset($typeData[Cfg::SCALE])) {
                        $result[MageType::OPT_SCALE] = $typeData[Cfg::SCALE];
                    }
                }
                break;
            case DemType::ATTR_OPTION:
                break;
            case DemType::ATTR_TEXT:
                $result = isset($typeData[Cfg::LENGTH]) ? $typeData[Cfg::LENGTH] : null;
                break;
        }
        return $result;
    }
1280474
public function getPDOType($value) {
        $type= null;
        if (is_null($value)) $type= \PDO::PARAM_NULL;
        elseif (is_scalar($value)) {
            if (is_int($value)) $type= \PDO::PARAM_INT;
            else $type= \PDO::PARAM_STR;
        }
        return $type;
    }