DB\SQL::type PHP Method

type() public method

Map data type of argument to a PDO constant
public type ( $val ) : integer
$val scalar
return integer
    function type($val)
    {
        switch (gettype($val)) {
            case 'NULL':
                return \PDO::PARAM_NULL;
            case 'boolean':
                return \PDO::PARAM_BOOL;
            case 'integer':
                return \PDO::PARAM_INT;
            case 'resource':
                return \PDO::PARAM_LOB;
            case 'float':
                return self::PARAM_FLOAT;
            default:
                return \PDO::PARAM_STR;
        }
    }