LessQL\Database::quote PHP Method

quote() public method

Quote a value for SQL
public quote ( mixed $value ) : string
$value mixed
return string
    function quote($value)
    {
        $value = $this->format($value);
        if ($value === null) {
            return "NULL";
        }
        if ($value === false) {
            return "'0'";
        }
        if ($value === true) {
            return "'1'";
        }
        if (is_int($value)) {
            return "'" . (string) $value . "'";
        }
        if (is_float($value)) {
            return "'" . sprintf("%F", $value) . "'";
        }
        if ($value instanceof Literal) {
            return $value->value;
        }
        return $this->pdo->quote($value);
    }