Changeset 19355


Ignore:
Timestamp:
2010/11/07 01:49:39 (13 years ago)
Author:
uchida
Message:

add lfGetIndexList function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/camp/camp-2_5-D/data/class/pages/admin/system/LC_Page_Admin_System_Editdb.php

    r19117 r19355  
    8080        } 
    8181 
     82        // インデックス一覧を取得する 
     83        $arrIndexList = $this->lfGetIndexList(); 
     84 
    8285        $objView->assignobj($this); 
    8386        $objView->display(MAIN_FRAME); 
     
    9295        parent::destroy(); 
    9396    } 
     97 
     98    /** 
     99     * インデックス設定を行う一覧を返す関数 
     100     * 
     101     * @return void 
     102     */ 
     103    function lfGetIndexList() 
     104    { 
     105        // データベースからインデックス設定一覧を取得する 
     106        $objQuery = new SC_Query(); 
     107        $objQuery->setOrder("table_name, column_name"); 
     108        $arrIndexList = $objQuery->select("table_name as table, column_name as column, recommend_flg, recommend_comment", "dtb_index_list"); 
     109 
     110        $table = ""; 
     111        foreach($arrIndexList as $key => $arrIndex) { 
     112            // テーブルに対するインデックス一覧を取得 
     113            if($table !== $arrIndex["table"]) { 
     114                $table = $arrIndex["table"]; 
     115                $arrIndexes = $objQuery->listTableIndexes($table); 
     116            } 
     117  
     118            // インデックスが設定されているかを取得 
     119            if(array_search($table . "_" . $arrIndex["column"] . "_key", $arrIndexes) === false) { 
     120                $arrIndexList[$key]["indexflag"] = false; 
     121            } else { 
     122                $arrIndexList[$key]["indexflag"] = true; 
     123            } 
     124        } 
     125     
     126        return $arrIndexList; 
     127    } 
     128 
    94129} 
Note: See TracChangeset for help on using the changeset viewer.