public function saveLob(Builder $query, $sql, array $values, array $binaries)
    {
        $id        = 0;
        $parameter = 0;
        $statement = $this->prepareStatement($query, $sql);

        $parameter = $this->bindValues($values, $statement, $parameter);

        $countBinary = count($binaries);
        for ($i = 0; $i < $countBinary; $i++) {
            $statement->bindParam($parameter, $binaries[$i], PDO::PARAM_LOB, -1);
            $parameter++;
        }

        // bind output param for the returning clause.
        $statement->bindParam($parameter, $id, PDO::PARAM_INT, 10);

        if (! $statement->execute()) {
            return false;
        }

        return (int) $id;
    }
public function saveLob(Builder $query, $sql, array $values, array $binaries)
    {
        $id        = 0;
        $parameter = 0;
        $statement = $this->prepareStatement($query, $sql);

        $parameter = $this->bindValues($values, $statement, $parameter);

        $countBinary = count($binaries);
        for ($i = 0; $i < $countBinary; $i++) {
            $statement->bindParam($parameter, $binaries[$i], PDO::PARAM_LOB, -1);
            $parameter++;
        }

        // bind output param for the returning clause.
        $statement->bindParam($parameter, $id, PDO::PARAM_INT, 10);

        if (! $statement->execute()) {
            return false;
        }

        return (int) $id;
    }
public function saveLob ( Builder $ query , $ sql , array $ values , array $ binaries ) { $ id = 0 ; $ parameter = 0 ; $ statement = $ this -> prepareStatement ( $ query , $ sql ) ; $ parameter = $ this -> bindValues ( $ values , $ statement , $ parameter ) ; $ countBinary = count ( $ binaries ) ; for ( $ i = 0 ; $ i < $ countBinary ; $ i ++ ) { $ statement -> bindParam ( $ parameter , $ binaries [ $ i ] , PDO :: PARAM_LOB , - 1 ) ; $ parameter ++ ; } // bind output param for the returning clause. $ statement -> bindParam ( $ parameter , $ id , PDO :: PARAM_INT , 10 ) ; if ( ! $ statement -> execute ( ) ) { return false ; } return ( int ) $ id ; }
Save Query with Blob returning primary key value.

@param  Builder $query
@param  string $sql
@param  array $values
@param  array $binaries
@return int
Save Query with Blob returning primary key value .