public function buildCondition($condition, &$params)
    {
        if ($condition instanceof Expression) {
            foreach ($condition->params as $n => $v) {
                $params[$n] = $v;
            }

            return $condition->expression;
        }
        elseif (!is_array($condition)) {
            return (string) $condition;
        }
        elseif (empty($condition)) {
            return '';
        }

        if (isset($condition[0])) { // operator format: operator, operand 1, operand 2, ...
            $operator = strtoupper($condition[0]);

            if (isset($this->conditionBuilders[$operator])) {
                $method = $this->conditionBuilders[$operator];
            }
            else {
                $method = 'buildSimpleCondition';
            }

            array_shift($condition);

            return $this->$method($operator, $condition, $params);
        }
        else { // hash format: 'column1' => 'value1', 'column2' => 'value2', ...
            return $this->buildHashCondition($condition, $params);
        }
    }