1) { $e = call_user_func_array("sprintf", func_get_args()); } $this->expression = trim($e); } /** * Get the string expression * @return string */ function __toString() { $string = $this->expression; if ($this->next) { $string .= " " . $this->next; } return (string) $string; } /** * Check for NULL * @return bool */ function isNull() { return !strcasecmp($this->expression, "null"); } /** * Append an expresssion * @param \pq\Query\Expr $next * @return \pq\Query\Expr $this * @throws \UnexpectedValueException if any expr is NULL */ function add(Expr $next) { if ($this->isNull()) { throw new \UnexpectedValueException("Cannot add anything to NULL"); } if ($this->next) { $this->next->add($next); } else { $this->next = $next; } return $this; } }