/**
  * ルートフォルダ挿入
  *
  * @param $community_id
  */
 static function insert_root_folder($community_id)
 {
     $folder_row = array();
     $timestamp = ACSLib::convert_timestamp_to_pg_date();
     $folder_row['folder_id'] = ACSDB::get_next_seq('folder_id_seq');
     $folder_row['community_id'] = $community_id;
     $folder_row['folder_name'] = ACSMsg::get_mdmsg(__FILE__, 'M001');
     $folder_row['comment'] = "";
     $folder_row['parent_folder_id'] = "";
     $folder_row['entry_user_community_id'] = $community_id;
     $folder_row['entry_date'] = $timestamp;
     $folder_row['update_user_community_id'] = $community_id;
     $folder_row['update_date'] = $timestamp;
     $folder_row['open_level_code'] = "";
     ACSDB::_do_query("BEGIN");
     $ret = ACSFolderModel::insert_folder($folder_row);
     if (!$ret) {
         ACSDB::_do_query("ROLLBACK");
         return $ret;
     }
     ACSDB::_do_query("COMMIT");
     return $ret;
 }
示例#2
0
 /**
  * フォルダ作成
  *
  * @param $input_folder_row
  *
  * @return $ret
  */
 function create_folder($input_folder_row)
 {
     $acs_user_info_row = $this->get_acs_user_info_row();
     $acs_user_community_id = $acs_user_info_row['user_community_id'];
     // フォルダの値セット
     $folder_row = array();
     $timestamp_pg_date = ACSLib::convert_timestamp_to_pg_date();
     $folder_id = ACSDB::get_next_seq('folder_id_seq');
     if ($input_folder_row['entry_date']) {
         $entry_date = $input_folder_row['entry_date'];
     } else {
         $entry_date = $timestamp_pg_date;
     }
     $update_date = $entry_date;
     $folder_row['folder_id'] = $folder_id;
     $folder_row['community_id'] = $this->get_community_id();
     $folder_row['folder_name'] = $input_folder_row['folder_name'];
     $folder_row['comment'] = $input_folder_row['comment'];
     $folder_row['parent_folder_id'] = $this->get_folder_id();
     $folder_row['entry_user_community_id'] = $acs_user_community_id;
     $folder_row['entry_date'] = $entry_date;
     $folder_row['update_user_community_id'] = $acs_user_community_id;
     $folder_row['update_date'] = $update_date;
     $folder_row['open_level_code'] = $input_folder_row['open_level_code'];
     $trusted_community_id_array = $input_folder_row['trusted_community_id_array'];
     /* フォルダ作成 */
     $ret = ACSFolderModel::insert_folder($folder_row, $trusted_community_id_array);
     if (!$ret) {
         return $ret;
     }
     /* 親フォルダの更新日を更新 */
     $ret = ACSFolderModel::update_folder_update_date($this->get_folder_id(), $acs_user_community_id, $update_date);
     if (!$ret) {
         return $ret;
     }
     /* フォルダリストに追加 */
     $folder_obj = ACSFolder::get_folder_instance($folder_row);
     array_push($this->folder_obj_array, $folder_obj);
     return $ret;
 }