Ruckusing_Adapter_PgSQL_Base::quote PHP Method

quote() public method

Quote a string
public quote ( string $value, string $column = null ) : string
$value string the string
$column string the column
return string
    public function quote($value, $column = null)
    {
        $type = gettype($value);
        if ($type == "double") {
            return "'{$value}'";
        } elseif ($type == "integer") {
            return "'{$value}'";
        } else {
            // TODO: this global else is probably going to be problematic.
            // I think eventually we'll need to do more introspection and handle all possible types
            return "'{$value}'";
        }
        /*
         "boolean"
        "integer"
        "double" (for historical reasons "double" is returned in case of a float, and not simply "float")
        "string"
        "array"
        "object"
        "resource"
        "NULL"
        "unknown type"
        */
    }