- function exec(\pq\Connection $c) {
- return $c->execParams($this, $this->params, $this->types);
+ function criteria(array $criteria) {
+ if ((list($left, $right) = each($criteria))) {
+ $this->write("(");
+ if (is_array($right)) {
+ $this->criteria($right);
+ } else {
+ $this->write("(", $left, $this->param($right), ")");
+ }
+ while ((list($left, $right) = each($criteria))) {
+ $this->write(is_int($left) && is_array($right) ? "OR" : "AND");
+ if (is_array($right)) {
+ $this->criteria($right);
+ } else {
+ $this->write("(", $left, $this->param($right), ")");
+ }
+ }
+ $this->write(")");
+ }
+ return $this;