Ignore:
Timestamp:
2011/02/21 18:35:54 (13 years ago)
Author:
coelacanth
Message:

#964 リファクタリング 宣言を除き, 引数や返り値が無く, すべて内部のメンバ変数で処理するような関数は極力作成しない

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Control.php

    r20270 r20300  
    7575        SC_Utils_Ex::sfIsSuccess($objSess); 
    7676 
    77         // パラメータ管理クラス 
    78         $this->objFormParam = new SC_FormParam(); 
    79         // パラメータ情報の初期化 
    80         $this->lfInitParam(); 
    81         // POST値の取得 
    82         $this->objFormParam->setParam($_POST); 
     77        $objFormParam = new SC_FormParam(); 
     78        $this->lfInitParam($objFormParam); 
     79        $objFormParam->setParam($_POST); 
    8380 
    8481        switch($this->getMode()) { 
    8582            case 'edit': 
    8683                // 入力値の変換 
    87                 $this->objFormParam->convParam(); 
     84                $objFormParam->convParam(); 
    8885 
    8986                // エラーチェック 
    9087                $this->arrErr = $this->lfCheckError(); 
    9188                if(count($this->arrErr) == 0) { 
    92                     $this->lfSiteControlData($_POST['control_id']); 
     89                    $this->lfSiteControlData($_POST['control_id'], $objFormParam->getHashArray()); 
    9390                    // javascript実行 
    9491                    $this->tpl_onload = "alert('更新が完了しました。');"; 
     
    140137 
    141138    /* パラメータ情報の初期化 */ 
    142     function lfInitParam() { 
    143         $this->objFormParam->addParam("設定状況", "control_flg", INT_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 
     139    function lfInitParam(&$objFormParam) { 
     140        $objFormParam->addParam("設定状況", "control_flg", INT_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK")); 
    144141    } 
    145142 
    146143    /* 入力内容のチェック */ 
    147     function lfCheckError() { 
     144    function lfCheckError(&$objFormParam) { 
    148145        // 入力データを渡す。 
    149         $arrRet =  $this->objFormParam->getHashArray(); 
     146        $arrRet =  $objFormParam->getHashArray(); 
    150147        $objErr = new SC_CheckError($arrRet); 
    151         $objErr->arrErr = $this->objFormParam->checkError(); 
     148        $objErr->arrErr = $objFormParam->checkError(); 
    152149 
    153150        return $objErr->arrErr; 
     
    155152 
    156153    /* DBへデータを登録する */ 
    157     function lfSiteControlData($control_id = "") { 
     154    function lfSiteControlData($control_id = "", $post) { 
    158155        $objQuery =& SC_Query::getSingletonInstance(); 
    159         $sqlval = $this->objFormParam->getHashArray(); 
     156        $sqlval = $post; 
    160157        $sqlval['update_date'] = 'Now()'; 
    161158 
     
    163160        if($control_id == "") { 
    164161            // INSERTの実行 
    165             //$sqlval['creator_id'] = $_SESSION['member_id']; 
    166162            $sqlval['create_date'] = 'Now()'; 
    167163            $objQuery->nextVal("dtb_site_control_control_id"); 
Note: See TracChangeset for help on using the changeset viewer.