Ignore:
Timestamp:
2012/06/19 16:15:24 (12 years ago)
Author:
pineray
Message:

#1669 #1859 初期化漏れ、無駄な変数等

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/SC_FormParam.php

    r21921 r21925  
    336336    function getHashArray($arrKey = array()) { 
    337337        $arrRet = array(); 
    338         foreach ($this->keyname as $index => $keyname) { 
     338        foreach ($this->keyname as $keyname) { 
    339339            if (empty($arrKey) || in_array($keyname, $arrKey)) { 
    340340                $arrRet[$keyname] = $this->getValue($keyname); 
     
    346346    // DB格納用配列の作成 
    347347    function getDbArray() { 
     348        $dbArray = array(); 
    348349        foreach ($this->keyname as $index => $key) { 
    349350            if ($this->input_db[$index]) { 
    350                 $arrRet[$key] = $this->getValue($key); 
    351             } 
    352         } 
    353         return $arrRet; 
     351                $dbArray[$key] = $this->getValue($key); 
     352            } 
     353        } 
     354        return $dbArray; 
    354355    } 
    355356 
     
    378379    // フォームに渡す用のパラメーターを返す 
    379380    function getFormParamList() { 
     381        $formParamList = array(); 
    380382        foreach ($this->keyname as $index => $key) { 
    381383            // キー名 
    382             $arrRet[$key]['keyname'] = $key; 
     384            $formParamList[$key]['keyname'] = $key; 
    383385            // 表示名 
    384             $arrRet[$key]['disp_name'] = $this->disp_name[$index]; 
     386            $formParamList[$key]['disp_name'] = $this->disp_name[$index]; 
    385387            // 文字数制限 
    386             $arrRet[$key]['length'] = $this->length[$index]; 
     388            $formParamList[$key]['length'] = $this->length[$index]; 
    387389            // 入力値 
    388             $arrRet[$key]['value'] = $this->getValue($key); 
    389         } 
    390         return $arrRet; 
     390            $formParamList[$key]['value'] = $this->getValue($key); 
     391        } 
     392        return $formParamList; 
    391393    } 
    392394 
     
    403405    function getValue($keyname, $default = '') { 
    404406        $ret = null; 
    405         foreach ($this->keyname as $index => $key) { 
     407        foreach ($this->keyname as $key) { 
    406408            if ($key == $keyname) { 
    407409                $ret = isset($this->arrValue[$key]) ? $this->arrValue[$key] : $this->arrDefault[$key]; 
     
    482484    function getSearchArray($prefix = 'search_') { 
    483485        $arrResults = array(); 
    484         foreach ($this->keyname as $index => $key) { 
     486        foreach ($this->keyname as $key) { 
    485487            if (preg_match('/^' . $prefix . '/', $key)) { 
    486488                $arrResults[$key] = $this->getValue($key); 
     
    497499     */ 
    498500    function getFormDispArray() { 
     501        $formDispArray = array(); 
    499502        foreach ($this->keyname as $index => $key) { 
    500503            // キー名 
    501             $arrRet[$index]['keyname'] = $key; 
     504            $formDispArray[$index]['keyname'] = $key; 
    502505            // 表示名 
    503             $arrRet[$index]['disp_name']  = $this->disp_name[$index]; 
     506            $formDispArray[$index]['disp_name']  = $this->disp_name[$index]; 
    504507            // 文字数制限 
    505             $arrRet[$index]['length'] = $this->length[$index]; 
     508            $formDispArray[$index]['length'] = $this->length[$index]; 
    506509            // 入力値 
    507             $arrRet[$index]['value'] = $this->getValue($key); 
    508         } 
    509         return $arrRet; 
     510            $formDispArray[$index]['value'] = $this->getValue($key); 
     511        } 
     512        return $formDispArray; 
    510513    } 
    511514 
     
    521524            // $this->paramに歯抜けが存在する場合は、NULLで埋めておく。 
    522525            // 最後に配列を詰める際に、全ての項目が埋まっている必要がある。 
    523             foreach ($this->keyname as $key => $val) { 
     526            foreach (array_keys($this->keyname) as $key) { 
    524527                if (!isset($this->param[$key])) { 
    525528                    $this->param[$key] = NULL; 
Note: See TracChangeset for help on using the changeset viewer.