Horde_Db_Adapter_Base::insertBlob PHP Method

insertBlob() public method

Inserts a row including BLOBs into a table.
public insertBlob ( string $table, array $fields, string $pk = null, integer $idValue = null ) : integer
$table string The table name.
$fields array A hash of column names and values. BLOB columns must be provided as Horde_Db_Value_Binary objects.
$pk string The primary key column.
$idValue integer The primary key value. This parameter is required if the primary key is inserted manually.
return integer Last inserted ID.
    public function insertBlob($table, $fields, $pk = null, $idValue = null)
    {
        $query = sprintf('INSERT INTO %s (%s) VALUES (%s)', $this->quoteTableName($table), implode(', ', array_map(array($this, 'quoteColumnName'), array_keys($fields))), implode(', ', array_fill(0, count($fields), '?')));
        return $this->insert($query, $fields, null, $pk, $idValue);
    }