tests
[m6w6/pq-gateway] / lib / pq / Query / Expr.php
index ae87c1f92abe4b4bdd4d20f1cc6d5c2d9f9b6ce0..0f3d86e52ba1db3ae3cfb99ca9391e7f3e2396e1 100644 (file)
@@ -18,7 +18,7 @@ class Expr
         * @param string $e the expression or a format string followed by arguments
         * @param string ...
         */
-       function __construct($e) {
+       function __construct($e, $arg = null) {
                if (func_num_args() > 1) {
                        $e = call_user_func_array("sprintf", func_get_args());
                }
@@ -30,7 +30,11 @@ class Expr
         * @return string
         */
        function __toString() {
-               return (string) $this->expression . $this->next;
+               $string = $this->expression;
+               if ($this->next) {
+                       $string .= " " . $this->next;
+               }
+               return (string) $string;
        }
        
        /**