protected function buildConditionString($field, $bind, $operator)
    {
        if (is_array($bind)) {
            foreach ($bind as &$val) {
                $val = $this->buildConditionString($field, $val, $operator);
                unset($val);
            }

            $logical = $operator === '!=' ? ' and ' : ' or ';

            return '(' . implode($logical, $bind) . ')';
        }

        if ($bind === null) {
            return $field . ' ' . ($operator == '!=' ? 'IS NOT NULL' : 'IS NULL');
        }

        if ($operator === 'regexp') {
            return sprintf('%s regexp %s', $field, $bind);
        }

        return $field . ' ' . $operator . ' ' . $bind;
    }
protected function buildConditionString($field, $bind, $operator)
    {
        if (is_array($bind)) {
            foreach ($bind as &$val) {
                $val = $this->buildConditionString($field, $val, $operator);
                unset($val);
            }

            $logical = $operator === '!=' ? ' and ' : ' or ';

            return '(' . implode($logical, $bind) . ')';
        }

        if ($bind === null) {
            return $field . ' ' . ($operator == '!=' ? 'IS NOT NULL' : 'IS NULL');
        }

        if ($operator === 'regexp') {
            return sprintf('%s regexp %s', $field, $bind);
        }

        return $field . ' ' . $operator . ' ' . $bind;
    }
protected function buildConditionString ( $ field , $ bind , $ operator ) { if ( is_array ( $ bind ) ) { foreach ( $ bind as & $ val ) { $ val = $ this -> buildConditionString ( $ field , $ val , $ operator ) ; unset ( $ val ) ; } $ logical = $ operator === '!=' ? ' and ' : ' or ' ; return '(' . implode ( $ logical , $ bind ) . ')' ; } if ( $ bind === null ) { return $ field . ' ' . ( $ operator == '!=' ? 'IS NOT NULL' : 'IS NULL' ) ; } if ( $ operator === 'regexp' ) { return sprintf ( '%s regexp %s' , $ field , $ bind ) ; } return $ field . ' ' . $ operator . ' ' . $ bind ; }
Builds condition string

@param string       $field
@param string|array $bind
@param string       $operator

@return string
Builds condition string