public function compileInsertLob(Builder $query, $values, $binaries, $sequence = 'id')
    {
        if (empty($sequence)) {
            $sequence = 'id';
        }

        $table = $this->wrapTable($query->from);

        if (! is_array(reset($values))) {
            $values = [$values];
        }

        if (! is_array(reset($binaries))) {
            $binaries = [$binaries];
        }

        $columns       = $this->columnize(array_keys(reset($values)));
        $binaryColumns = $this->columnize(array_keys(reset($binaries)));
        $columns .= (empty($columns) ? '' : ', ') . $binaryColumns;

        $parameters       = $this->parameterize(reset($values));
        $binaryParameters = $this->parameterize(reset($binaries));

        $value       = array_fill(0, count($values), "$parameters");
        $binaryValue = array_fill(0, count($binaries), str_replace('?', 'EMPTY_BLOB()', $binaryParameters));

        $value      = array_merge($value, $binaryValue);
        $parameters = implode(', ', array_filter($value));

        return "insert into $table ($columns) values ($parameters) returning " . $binaryColumns . ', ' . $this->wrap($sequence) . ' into ' . $binaryParameters . ', ?';
    }
public function compileInsertLob(Builder $query, $values, $binaries, $sequence = 'id')
    {
        if (empty($sequence)) {
            $sequence = 'id';
        }

        $table = $this->wrapTable($query->from);

        if (! is_array(reset($values))) {
            $values = [$values];
        }

        if (! is_array(reset($binaries))) {
            $binaries = [$binaries];
        }

        $columns       = $this->columnize(array_keys(reset($values)));
        $binaryColumns = $this->columnize(array_keys(reset($binaries)));
        $columns .= (empty($columns) ? '' : ', ') . $binaryColumns;

        $parameters       = $this->parameterize(reset($values));
        $binaryParameters = $this->parameterize(reset($binaries));

        $value       = array_fill(0, count($values), "$parameters");
        $binaryValue = array_fill(0, count($binaries), str_replace('?', 'EMPTY_BLOB()', $binaryParameters));

        $value      = array_merge($value, $binaryValue);
        $parameters = implode(', ', array_filter($value));

        return "insert into $table ($columns) values ($parameters) returning " . $binaryColumns . ', ' . $this->wrap($sequence) . ' into ' . $binaryParameters . ', ?';
    }
public function compileInsertLob ( Builder $ query , $ values , $ binaries , $ sequence = 'id' ) { if ( empty ( $ sequence ) ) { $ sequence = 'id' ; } $ table = $ this -> wrapTable ( $ query -> from ) ; if ( ! is_array ( reset ( $ values ) ) ) { $ values = [ $ values ] ; } if ( ! is_array ( reset ( $ binaries ) ) ) { $ binaries = [ $ binaries ] ; } $ columns = $ this -> columnize ( array_keys ( reset ( $ values ) ) ) ; $ binaryColumns = $ this -> columnize ( array_keys ( reset ( $ binaries ) ) ) ; $ columns .= ( empty ( $ columns ) ? '' : ', ' ) . $ binaryColumns ; $ parameters = $ this -> parameterize ( reset ( $ values ) ) ; $ binaryParameters = $ this -> parameterize ( reset ( $ binaries ) ) ; $ value = array_fill ( 0 , count ( $ values ) , "$parameters" ) ; $ binaryValue = array_fill ( 0 , count ( $ binaries ) , str_replace ( '?' , 'EMPTY_BLOB()' , $ binaryParameters ) ) ; $ value = array_merge ( $ value , $ binaryValue ) ; $ parameters = implode ( ', ' , array_filter ( $ value ) ) ; return "insert into $table ($columns) values ($parameters) returning " . $ binaryColumns . ', ' . $ this -> wrap ( $ sequence ) . ' into ' . $ binaryParameters . ', ?' ; }
Compile an insert with blob field statement into SQL.

@param  \Illuminate\Database\Query\Builder $query
@param  array $values
@param  array $binaries
@param  string $sequence
@return string
Compile an insert with blob field statement into SQL .