protected function interpolateParams()
    {
        if( count($this->params) <= 0 ) {
            return;
        }
        if( $this->quoteCallback ) {
            $cb = $this->quoteCallback;
        } else if( $this->database ) {
            $cb = array($this->database, 'quote');
        } else {
            throw new LogicException('Interpolation not available without '
            . 'setting a quote callback or database adapter');
        }
        if( substr_count($this->query, '?') != count($this->params) ) {
            throw new LogicException('Parameter count mismatch: ' . $this->query);
        }

        $parts = explode('?', $this->query);
        $query = $parts[0];
        for( $i = 0, $l = count($this->params); $i < $l; $i++ ) {
            $query .= call_user_func($cb, $this->params[$i]) . $parts[$i + 1];
        }
        $this->query = $query;
    }