protected static function dbType(array $typeDef) {
        $dbtype = $typeDef['dbtype'];

        if (!empty($typeDef['maxLength'])) {
            $dbtype .= "({$typeDef['maxLength']})";
        } elseif (!empty($typeDef['unsigned'])) {
            $dbtype = 'u'.$dbtype;
        } elseif (!empty($typeDef['precision'])) {
            $dbtype .= "({$typeDef['precision']}";
            if (!empty($typeDef['scale'])) {
                $dbtype .= ",{$typeDef['scale']}";
            }
            $dbtype .= ')';
        } elseif (!empty($typeDef['enum'])) {
            $parts = array_map(function ($str) {
                return "'{$str}'";
            }, $typeDef['enum']);
            $dbtype .= '('.implode(',', $parts).')';
        }
        return $dbtype;
    }
protected static function dbType(array $typeDef) {
        $dbtype = $typeDef['dbtype'];

        if (!empty($typeDef['maxLength'])) {
            $dbtype .= "({$typeDef['maxLength']})";
        } elseif (!empty($typeDef['unsigned'])) {
            $dbtype = 'u'.$dbtype;
        } elseif (!empty($typeDef['precision'])) {
            $dbtype .= "({$typeDef['precision']}";
            if (!empty($typeDef['scale'])) {
                $dbtype .= ",{$typeDef['scale']}";
            }
            $dbtype .= ')';
        } elseif (!empty($typeDef['enum'])) {
            $parts = array_map(function ($str) {
                return "'{$str}'";
            }, $typeDef['enum']);
            $dbtype .= '('.implode(',', $parts).')';
        }
        return $dbtype;
    }
protected static function dbType ( array $ typeDef ) { $ dbtype = $ typeDef [ 'dbtype' ] ; if ( ! empty ( $ typeDef [ 'maxLength' ] ) ) { $ dbtype .= "({$typeDef['maxLength']})" ; } elseif ( ! empty ( $ typeDef [ 'unsigned' ] ) ) { $ dbtype = 'u' . $ dbtype ; } elseif ( ! empty ( $ typeDef [ 'precision' ] ) ) { $ dbtype .= "({$typeDef['precision']}" ; if ( ! empty ( $ typeDef [ 'scale' ] ) ) { $ dbtype .= ",{$typeDef['scale']}" ; } $ dbtype .= ')' ; } elseif ( ! empty ( $ typeDef [ 'enum' ] ) ) { $ parts = array_map ( function ( $ str ) { return "'{$str}'" ; } , $ typeDef [ 'enum' ] ) ; $ dbtype .= '(' . implode ( ',' , $ parts ) . ')' ; } return $ dbtype ; }
Get the database type string from a type definition.

This is the opposite of {@link Db::typeDef()}.

@param array $typeDef The type definition array.
@return string Returns a db type string.
Get the database type string from a type definition .