private function getInfixExpr(&$out, array $currTriple) { # parseEncodedToken(), getSqlToken() in infix mode self::$valid_logical_ops = array('and', 'or'); self::$valid_bracket_ops = array('(', ')'); $this->infixLevel++; if ($this->infixLevel != 0) { $this->infix_tokens[] = (object) array('type' => 'bracket', 'value' => '('); $out .= '('; } if (isset($currTriple[0])) { if (is_array($currTriple[0])) { $this->getInfixExpr($out, $currTriple[0]); } else { $this->infix_tokens[] = $currTriple[0]; $out .= $this->getSqlToken($currTriple[0]); } } if (isset($currTriple[1])) { $this->infix_tokens[] = $currTriple[1]; $out .= ' ' . $this->getSqlToken($currTriple[1]) . ' '; } if (isset($currTriple[2])) { if (is_array($currTriple[2])) { $this->getInfixExpr($out, $currTriple[2]); } else { $this->infix_tokens[] = $currTriple[2]; $out .= $this->getSqlToken($currTriple[2]); } } if ($this->infixLevel != 0) { $this->infix_tokens[] = (object) array('type' => 'bracket', 'value' => ')'); $out .= ')'; } $this->infixLevel--; }