1) { $e = call_user_func_array("sprintf", func_get_args()); } $this->expression = trim($e); } /** * Get the string expression * @return string */ function __toString() { return (string) $this->expression . $this->next; } /** * 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() || $next->isNull()) { throw new \UnexpectedValueException("Cannot add anything to NULL"); } for ($that = $this; $that->next; $that = $that->next); $that->next = $next; return $this; } }