[Svn-src-all:1409] [version-2_5-dev 20300] #964 リファクタリング 宣言を除き, 引数や返り値が無く, すべて内部のメンバ変数で処理するような関数は極力作成しない

coelacanth admin @ mail.ec-cube.net
2011年 2月 21日 (月) 18:35:54 JST


Subversion committed to /home/svn/open 20300
http://svn.ec-cube.net/open_trac/changeset/20300
┌────────────────────────────┐
│更新者 :  coelacanth                                   │
│更新日時:  2011-02-21 18:35:54 +0900 (月, 21  2月 2011)│
└────────────────────────────┘

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

Changed:                      [U:修正,A:追加,D:削除]
--------------------------------------------------------
U   branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Control.php

変更: branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Control.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Control.php	2011-02-21 08:30:13 UTC (rev 20299)
+++ branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis_Control.php	2011-02-21 09:35:54 UTC (rev 20300)
@@ -74,22 +74,19 @@
         // 認証可否の判定
         SC_Utils_Ex::sfIsSuccess($objSess);
 
-        // パラメータ管理クラス
-        $this->objFormParam = new SC_FormParam();
-        // パラメータ情報の初期化
-        $this->lfInitParam();
-        // POST値の取得
-        $this->objFormParam->setParam($_POST);
+        $objFormParam = new SC_FormParam();
+        $this->lfInitParam($objFormParam);
+        $objFormParam->setParam($_POST);
 
         switch($this->getMode()) {
             case 'edit':
                 // 入力値の変換
-                $this->objFormParam->convParam();
+                $objFormParam->convParam();
 
                 // エラーチェック
                 $this->arrErr = $this->lfCheckError();
                 if(count($this->arrErr) == 0) {
-                    $this->lfSiteControlData($_POST['control_id']);
+                    $this->lfSiteControlData($_POST['control_id'], $objFormParam->getHashArray());
                     // javascript実行
                     $this->tpl_onload = "alert('更新が完了しました。');";
                 }
@@ -139,30 +136,29 @@
     }
 
     /* パラメータ情報の初期化 */
-    function lfInitParam() {
-        $this->objFormParam->addParam("設定状況", "control_flg", INT_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK"));
+    function lfInitParam(&$objFormParam) {
+        $objFormParam->addParam("設定状況", "control_flg", INT_LEN, "n", array("EXIST_CHECK", "NUM_CHECK", "MAX_LENGTH_CHECK"));
     }
 
     /* 入力内容のチェック */
-    function lfCheckError() {
+    function lfCheckError(&$objFormParam) {
         // 入力データを渡す。
-        $arrRet =  $this->objFormParam->getHashArray();
+        $arrRet =  $objFormParam->getHashArray();
         $objErr = new SC_CheckError($arrRet);
-        $objErr->arrErr = $this->objFormParam->checkError();
+        $objErr->arrErr = $objFormParam->checkError();
 
         return $objErr->arrErr;
     }
 
     /* DBへデータを登録する */
-    function lfSiteControlData($control_id = "") {
+    function lfSiteControlData($control_id = "", $post) {
         $objQuery =& SC_Query::getSingletonInstance();
-        $sqlval = $this->objFormParam->getHashArray();
+        $sqlval = $post;
         $sqlval['update_date'] = 'Now()';
 
         // 新規登録
         if($control_id == "") {
             // INSERTの実行
-            //$sqlval['creator_id'] = $_SESSION['member_id'];
             $sqlval['create_date'] = 'Now()';
             $objQuery->nextVal("dtb_site_control_control_id");
             $objQuery->insert("dtb_site_control", $sqlval);




Svn-src-all メーリングリストの案内