protected function compileQuery()
    {
        $query = $this->sql;

        // Auto-generate the SET/VALUES subpart
        if (strncasecmp($query, 'INSERT', 6) === 0 || strncasecmp($query, 'UPDATE', 6) === 0) {
            $query = str_replace('%s', '%p', $query);
        }

        // Replace wildcards
        $chunks = preg_split("/('[^']*')/", $query, -1, (PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY));

        foreach ($chunks as $k => $v) {
            if (substr($v, 0, 1) == "'") {
                continue;
            }

            $chunks[$k] = str_replace('?', '%s', $v);
        }

        $query = implode('', $chunks);


        $query = preg_replace('/(?<!%)%([^bcdufosxX%])/', '%%$1', $query);

        // Replace wildcards
        // @codingStandardsIgnoreStart
        if (($this->compiledQuery = @vsprintf($query, $this->escapeParameters())) == false) {
        // @codingStandardsIgnoreEnd
            throw new \Exception('Too few arguments to build the query string');
        }
    }
protected function compileQuery()
    {
        $query = $this->sql;

        // Auto-generate the SET/VALUES subpart
        if (strncasecmp($query, 'INSERT', 6) === 0 || strncasecmp($query, 'UPDATE', 6) === 0) {
            $query = str_replace('%s', '%p', $query);
        }

        // Replace wildcards
        $chunks = preg_split("/('[^']*')/", $query, -1, (PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY));

        foreach ($chunks as $k => $v) {
            if (substr($v, 0, 1) == "'") {
                continue;
            }

            $chunks[$k] = str_replace('?', '%s', $v);
        }

        $query = implode('', $chunks);


        $query = preg_replace('/(?<!%)%([^bcdufosxX%])/', '%%$1', $query);

        // Replace wildcards
        // @codingStandardsIgnoreStart
        if (($this->compiledQuery = @vsprintf($query, $this->escapeParameters())) == false) {
        // @codingStandardsIgnoreEnd
            throw new \Exception('Too few arguments to build the query string');
        }
    }
protected function compileQuery ( ) { $ query = $ this -> sql ; // Auto-generate the SET/VALUES subpart if ( strncasecmp ( $ query , 'INSERT' , 6 ) === 0 || strncasecmp ( $ query , 'UPDATE' , 6 ) === 0 ) { $ query = str_replace ( '%s' , '%p' , $ query ) ; } // Replace wildcards $ chunks = preg_split ( "/('[^']*')/" , $ query , - 1 , ( PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY ) ) ; foreach ( $ chunks as $ k => $ v ) { if ( substr ( $ v , 0 , 1 ) == "'" ) { continue ; } $ chunks [ $ k ] = str_replace ( '?' , '%s' , $ v ) ; } $ query = implode ( '' , $ chunks ) ; $ query = preg_replace ( '/(?<!%)%([^bcdufosxX%])/' , '%%$1' , $ query ) ; // Replace wildcards // @codingStandardsIgnoreStart if ( ( $ this -> compiledQuery = @ vsprintf ( $ query , $ this -> escapeParameters ( ) ) ) == false ) { // @codingStandardsIgnoreEnd throw new \ Exception ( 'Too few arguments to build the query string' ) ; } }
Compile the query into a string.

@return void

@throws \Exception When the arguments do not match the query.
Compile the query into a string .