Esempio n. 1
0
File: Sql.php Progetto: horde/horde
 /**
  * TODO
  *
  * @param string $table      TODO
  * @param string $field      TODO
  * @param string $data       TODO
  * @param string $where      TODO
  * @param array $alsoupdate  TODO
  *
  * @return mixed  TODO
  * @throws Horde_Vfs_Exception
  */
 protected function _updateBlob($table, $field, $data, $where, $alsoupdate)
 {
     $wherestring = '';
     $wherevalues = array();
     foreach ($where as $key => $value) {
         if (!empty($wherestring)) {
             $wherestring .= ' AND ';
         }
         $wherestring .= $key . ' = ?';
         $wherevalues[] = $value;
     }
     /* Execute the query. */
     try {
         $this->_db->updateBlob($table, array_merge($alsoupdate, array($field => new Horde_Db_Value_Binary($data))), array($wherestring, $wherevalues));
     } catch (Horde_Db_Exception $e) {
         throw new Horde_Vfs_Exception($e);
     }
 }