protected function translateInsert($key)
    {
        $build = ($this->attr('ignore') ? $key . ' ignore' : $key);

        $build .= ' into ' . $this->escapeTable(false) . ' ';

        if (!$valueCollection = $this->attr('values'))
        {
            throw new Exception('Cannot build insert query without values.');
        }

        // Get the array keys from the first array in the collection.
        // We use them as insert keys. If you pass an array collection with
        // missing keys or a diffrent structure well... f*ck
        $build .= '(' . $this->escapeList(array_keys(reset($valueCollection))) . ') values ';

        // add the array values.
        foreach ($valueCollection as $values) 
        {
            $build .= '(' . $this->parameterize($values) . '), ';
        }

        // cut the last comma away
        return substr($build, 0, -2);
    }
protected function translateInsert($key)
    {
        $build = ($this->attr('ignore') ? $key . ' ignore' : $key);

        $build .= ' into ' . $this->escapeTable(false) . ' ';

        if (!$valueCollection = $this->attr('values'))
        {
            throw new Exception('Cannot build insert query without values.');
        }

        // Get the array keys from the first array in the collection.
        // We use them as insert keys. If you pass an array collection with
        // missing keys or a diffrent structure well... f*ck
        $build .= '(' . $this->escapeList(array_keys(reset($valueCollection))) . ') values ';

        // add the array values.
        foreach ($valueCollection as $values) 
        {
            $build .= '(' . $this->parameterize($values) . '), ';
        }

        // cut the last comma away
        return substr($build, 0, -2);
    }
protected function translateInsert ( $ key ) { $ build = ( $ this -> attr ( 'ignore' ) ? $ key . ' ignore' : $ key ) ; $ build .= ' into ' . $ this -> escapeTable ( false ) . ' ' ; if ( ! $ valueCollection = $ this -> attr ( 'values' ) ) { throw new Exception ( 'Cannot build insert query without values.' ) ; } // Get the array keys from the first array in the collection. // We use them as insert keys. If you pass an array collection with // missing keys or a diffrent structure well... f*ck $ build .= '(' . $ this -> escapeList ( array_keys ( reset ( $ valueCollection ) ) ) . ') values ' ; // add the array values. foreach ( $ valueCollection as $ values ) { $ build .= '(' . $ this -> parameterize ( $ values ) . '), ' ; } // cut the last comma away return substr ( $ build , 0 , - 2 ) ; }
Translate the current query to an SQL insert statement

@return string
Translate the current query to an SQL insert statement