ae87c1f92abe4b4bdd4d20f1cc6d5c2d9f9b6ce0
10 protected $expression;
18 * @param string $e the expression or a format string followed by arguments
21 function __construct($e) {
22 if (func_num_args() > 1) {
23 $e = call_user_func_array("sprintf", func_get_args());
25 $this->expression
= trim($e);
29 * Get the string expression
32 function __toString() {
33 return (string) $this->expression
. $this->next
;
41 return !strcasecmp($this->expression
, "null");
45 * Append an expresssion
46 * @param \pq\Query\Expr $next
47 * @return \pq\Query\Expr $this
48 * @throws \UnexpectedValueException if any expr is NULL
50 function add(Expr
$next) {
51 if ($this->isNull() ||
$next->isNull()) {
52 throw new \
UnexpectedValueException("Cannot add anything to NULL");
54 for ($that = $this; $that->next
; $that = $that->next
);