[Svn-src-all:844] [version-2_5-dev 19731] #855(SC_Query の #select, #getRow, #getCol, #get, #min, #max の引数順を統一する)

Seasoft admin @ mail.ec-cube.net
2010年 12月 16日 (木) 23:21:59 JST


Subversion committed to /home/svn/open 19731
http://svn.ec-cube.net/open_trac/changeset/19731
┌────────────────────────────┐
│更新者 :  Seasoft                                      │
│更新日時:  2010-12-16 23:21:59 +0900 (木, 16 12月 2010)│
└────────────────────────────┘

Log:
--------------------------------------------------------
#855(SC_Query の #select, #getRow, #getCol, #get, #min, #max の引数順を統一する)
  * SC_Query#getRow を改訂

Changed:                      [U:修正,A:追加,D:削除]
--------------------------------------------------------
U   branches/version-2_5-dev/data/class/SC_Query.php
U   branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php
U   branches/version-2_5-dev/data/class/helper/SC_Helper_Mobile.php
U   branches/version-2_5-dev/data/class/helper/SC_Helper_Purchase.php
U   branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php
U   branches/version-2_5-dev/test/class/SC_Query_Test.php

変更: branches/version-2_5-dev/data/class/SC_Query.php
===================================================================
--- branches/version-2_5-dev/data/class/SC_Query.php	2010-12-16 14:18:05 UTC (rev 19730)
+++ branches/version-2_5-dev/data/class/SC_Query.php	2010-12-16 14:21:59 UTC (rev 19731)
@@ -581,7 +581,7 @@
      * @param integer $fetchmode 使用するフェッチモード。デフォルトは MDB2_FETCHMODE_ASSOC。
      * @return array array('カラム名' => '値', ...)の連想配列
      */
-    function getRow($table, $col, $where = "", $arrVal = array(), $fetchmode = MDB2_FETCHMODE_ASSOC) {
+    function getRow($col, $table, $where = "", $arrVal = array(), $fetchmode = MDB2_FETCHMODE_ASSOC) {
 
         $sql = $this->getSql($col, $table, $where);
         $sql = $this->dbFactory->sfChangeMySQL($sql);

変更: branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php
===================================================================
--- branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php	2010-12-16 14:18:05 UTC (rev 19730)
+++ branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php	2010-12-16 14:21:59 UTC (rev 19731)
@@ -1889,7 +1889,7 @@
     function sfUpdateOrderStatus($orderId, $newStatus = null, $newAddPoint = null, $newUsePoint = null) {
         $objQuery =& SC_Query::getSingletonInstance();
 
-        $arrOrderOld = $objQuery->getRow('dtb_order', 'status, add_point, use_point, customer_id', 'order_id = ?', array($orderId));
+        $arrOrderOld = $objQuery->getRow('status, add_point, use_point, customer_id', 'dtb_order', 'order_id = ?', array($orderId));
 
         // 対応状況が変更無しの場合、DB値を引き継ぐ
         if (is_null($newStatus)) {

変更: branches/version-2_5-dev/data/class/helper/SC_Helper_Mobile.php
===================================================================
--- branches/version-2_5-dev/data/class/helper/SC_Helper_Mobile.php	2010-12-16 14:18:05 UTC (rev 19730)
+++ branches/version-2_5-dev/data/class/helper/SC_Helper_Mobile.php	2010-12-16 14:21:59 UTC (rev 19731)
@@ -391,8 +391,8 @@
         $objQuery = new SC_Query;
 
         $arrRow = $objQuery->getRow(
-             'dtb_mobile_kara_mail'
-            ,'session_id, next_url, email'
+             'session_id, next_url, email'
+            ,'dtb_mobile_kara_mail'
             ,'token = ? AND email IS NOT NULL AND receive_date >= ?'
             ,array($token, date('Y-m-d H:i:s', time() - MOBILE_SESSION_LIFETIME))
             ,DB_FETCHMODE_ORDERED

変更: branches/version-2_5-dev/data/class/helper/SC_Helper_Purchase.php
===================================================================
--- branches/version-2_5-dev/data/class/helper/SC_Helper_Purchase.php	2010-12-16 14:18:05 UTC (rev 19730)
+++ branches/version-2_5-dev/data/class/helper/SC_Helper_Purchase.php	2010-12-16 14:21:59 UTC (rev 19731)
@@ -85,7 +85,7 @@
      */
     function getOrderTemp($uniqId) {
         $objQuery =& SC_Query::getSingletonInstance();
-        return $objQuery->getRow("dtb_order_temp", "*", "order_temp_id = ?",
+        return $objQuery->getRow("*", "dtb_order_temp", "order_temp_id = ?",
                                  array($uniqId));
     }
 

変更: branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php	2010-12-16 14:18:05 UTC (rev 19730)
+++ branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php	2010-12-16 14:21:59 UTC (rev 19731)
@@ -247,9 +247,12 @@
                 $isUpdate = true;
                 // 更新の場合は規格組み合わせを検索し, 削除しておく
                 $class_combination_id = $exists[$arrList["product_class_id:".$i]]['class_combination_id'];
-                $existsCombi = $objQuery->getRow("dtb_class_combination",
-                                                 "*", "class_combination_id = ?",
-                                                 array($class_combination_id));
+                $existsCombi = $objQuery->getRow(
+                    "*",
+                    "dtb_class_combination",
+                    "class_combination_id = ?",
+                    array($class_combination_id)
+                );
 
                 $objQuery->delete("dtb_class_combination",
                                   "class_combination_id IN (?, ?)",
@@ -613,7 +616,7 @@
      */
     function getProductsClass($product_id) {
         $objQuery =& SC_Query::getSingletonInstance();
-        return $objQuery->getRow("dtb_products_class", "*", "product_id = ?", array($product_id));
+        return $objQuery->getRow("*", "dtb_products_class", "product_id = ?", array($product_id));
     }
 
     /**

変更: branches/version-2_5-dev/test/class/SC_Query_Test.php
===================================================================
--- branches/version-2_5-dev/test/class/SC_Query_Test.php	2010-12-16 14:18:05 UTC (rev 19730)
+++ branches/version-2_5-dev/test/class/SC_Query_Test.php	2010-12-16 14:21:59 UTC (rev 19731)
@@ -139,7 +139,7 @@
         $this->setTestData(3, "3", "f");
 
         $this->expected = array("column1" => 1, "column2" => 1);
-        $this->actual = $this->objQuery->getRow("test_table", "column1, column2", "id = ?", array(1));
+        $this->actual = $this->objQuery->getRow("column1, column2", "test_table", "id = ?", array(1));
         $this->verify();
     }
 




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