+ 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;