示例#1
0
 /**
  * 配列に対してget_sql_value()する (クォートで囲む、またはnullとする)
  *
  * @param 配列
  * @return 配列
  */
 static function get_sql_value_array(&$arr)
 {
     foreach ($arr as $key => $value) {
         if (is_scalar($value) || is_null($value)) {
             $arr[$key] = ACSLib::get_sql_value($value);
         }
     }
     return $arr;
 }
 /**
  * ファイル履歴コメントを登録する
  *
  * @param $file_history_id ファイル履歴ID
  * @param $entry_user_community_id 登録者のユーザコミュニティID
  * @param $comment コメント
  * @return 
  */
 static function set_file_history_comment($file_history_id, $entry_user_community_id, $comment)
 {
     $file_history_comment_id_seq = ACSDB::get_next_seq('file_history_comment_id_seq');
     $comment = ACSLib::get_sql_value(pg_escape_string($comment));
     $sql = "INSERT INTO file_history_comment";
     $sql .= " (file_history_comment_id, file_history_id, user_community_id, comment)";
     $sql .= " VALUES ({$file_history_comment_id_seq}, {$file_history_id}, '{$entry_user_community_id}', {$comment})";
     $ret = ACSDB::_do_query($sql);
     return $ret;
 }
 /**
  * フォルダ情報更新 (共通)
  *
  * @param  $target_folder_id
  * @param  $row
  * @return $ret 更新結果 (true/false)
  */
 static function update_folder($target_folder_id, $row)
 {
     $set_values = array();
     foreach ($row as $key => $value) {
         $value = pg_escape_string($value);
         $value = ACSLib::get_sql_value($value);
         $value_str = "";
         $value_str = " " . $key . " = " . $value;
         array_push($set_values, $value_str);
     }
     $sql = "UPDATE folder";
     $sql .= " SET";
     $sql .= implode(", ", $set_values);
     $sql .= " WHERE folder_id = " . $target_folder_id;
     $ret = ACSDB::_do_query($sql);
     return $ret;
 }