Ignore:
Timestamp:
2010/08/12 19:33:49 (14 years ago)
Author:
nanasess
bzr:base-revision:
svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18783
bzr:committer:
Kentaro Ohkouchi <ohkouchi@loop-az.jp>
bzr:file-ids:

data/class/SC_Query.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2FSC_Query.php
data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php 15123@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fdb%2Fdbfactory%2FSC_DB_DBFactory_MYSQL.php
data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php 15123@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fdb%2Fdbfactory%2FSC_DB_DBFactory_PGSQL.php
data/class/helper/SC_Helper_DB.php 15176@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fhelper%2FSC_Helper_DB.php
bzr:mapping-version:
v4
bzr:repository-uuid:
1e3b908f-19a9-db11-a64c-001125224ba8
bzr:revision-id:
ohkouchi@loop-az.jp-20100812103342-5fc7rp06997dbg6e
bzr:revno:
2267
bzr:revprop:branch-nick:
branches/version-2_5-dev
bzr:root:
branches/version-2_5-dev
bzr:text-parents:

data/class/SC_Query.php ohkouchi@loop-az.jp-20100804045224-nsulc26bh1ttqfrb
data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18777
data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php ohkouchi@loop-az.jp-20100804045224-nsulc26bh1ttqfrb
data/class/helper/SC_Helper_DB.php svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18777
bzr:timestamp:
2010-08-12 19:33:42.628999949 +0900
bzr:user-agent:
bzr2.1.2+bzr-svn1.0.2
svn:original-date:
2010-08-12T10:33:42.629000Z
Message:

#565関連(SC_DbConnの削除)

  • data/class/SC_Query.php
    • PHPDoc コメントを追加
    • コンストラクタの第二引数を $force_run に変更
    • SC_Query::isError() を PEAR::isError() に変更し, @deprecated コメント付与
    • SC_Query::getSingletonInstance() 関数を追加
    • SC_Query::inTransaction() 関数を追加
    • 内部変数のリファレンスを修正
    • setXXX 関数を Chain of Responsibility パターンに対応
  • data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php
    • SC_Query のインスタンスを SC_Query::getSingletonInstance() で取得するよう修正
  • data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php
    • SC_Query のインスタンスを SC_Query::getSingletonInstance() で取得するよう修正
  • data/class/helper/SC_Helper_DB.php
    • SC_Query のインスタンスを SC_Query::getSingletonInstance() で取得するよう修正
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/helper/SC_Helper_DB.php

    r18777 r18784  
    7070        $dsn = $dbFactory->getDSN($dsn); 
    7171 
    72         $objQuery = new SC_Query($dsn, true, true); 
     72        $objQuery =& SC_Query::getSingletonInstance(); 
    7373        // 正常に接続されている場合 
    7474        if(!$objQuery->isError()) { 
     
    109109        if(!$this->sfTabaleExists($table_name, $dsn)) return false; 
    110110 
    111         $objQuery = new SC_Query($dsn, true, true); 
     111        $objQuery =& SC_Query::getSingletonInstance(); 
    112112        // 正常に接続されている場合 
    113113        if(!$objQuery->isError()) { 
     
    155155        if (!$this->sfTabaleExists($table_name, $dsn)) return false; 
    156156 
    157         $objQuery = new SC_Query($dsn, true, true); 
     157        $objQuery =& SC_Query::getSingletonInstance(); 
    158158        $arrRet = $dbFactory->getTableIndex($index_name, $table_name); 
    159159 
     
    186186        $dsn = $dbFactory->getDSN($dsn); 
    187187 
    188         $objQuery = new SC_Query($dsn, true, true); 
     188        $objQuery =& SC_Query::getSingletonInstance(); 
    189189        $count = $objQuery->count($table_name, $where, $arrval); 
    190190 
     
    211211 
    212212        if ($force || !isset($data)) { 
    213             $objQuery = new SC_Query(); 
     213            $objQuery =& SC_Query::getSingletonInstance(); 
    214214            $arrRet = $objQuery->select('*', 'dtb_baseinfo'); 
    215215 
     
    229229        if(!$this->g_root_on)   { 
    230230            $this->g_root_on = true; 
    231             $objQuery = new SC_Query(); 
     231            $objQuery =& SC_Query::getSingletonInstance(); 
    232232 
    233233            if (!isset($_GET['product_id'])) $_GET['product_id'] = ""; 
     
    267267 
    268268        // 商品規格取得 
    269         $objQuery = new SC_Query(); 
     269        $objQuery =& SC_Query::getSingletonInstance(); 
    270270        $col = 'product_id, deliv_fee, name, product_code, main_list_image, main_image, price01, price02, point_rate, product_class_id, classcategory_id1, classcategory_id2, class_id1, class_id2, stock, stock_unlimited, sale_limit'; 
    271271        $table = 'vw_product_class AS prdcls'; 
     
    284284     */ 
    285285    function sfGetPayment() { 
    286         $objQuery = new SC_Query(); 
     286        $objQuery =& SC_Query::getSingletonInstance(); 
    287287        // 購入金額が条件額以下の項目を取得 
    288288        $where = "del_flg = 0"; 
     
    430430        if($uniqid != "") { 
    431431            // 既存データのチェック 
    432             $objQuery = new SC_Query(); 
     432            $objQuery =& SC_Query::getSingletonInstance(); 
    433433            $where = "order_temp_id = ?"; 
    434434            $cnt = $objQuery->count("dtb_order_temp", $where, array($uniqid)); 
     
    501501     */ 
    502502    function sfEditCustomerData($array, $arrRegistColumn) { 
    503         $objQuery = new SC_Query(); 
     503        $objQuery =& SC_Query::getSingletonInstance(); 
    504504 
    505505        foreach ($arrRegistColumn as $data) { 
     
    535535     */ 
    536536    function sfGetCustomerPoint($order_id, $use_point, $add_point) { 
    537         $objQuery = new SC_Query(); 
     537        $objQuery =& SC_Query::getSingletonInstance(); 
    538538        $arrRet = $objQuery->select("customer_id", "dtb_order", "order_id = ?", array($order_id)); 
    539539        $customer_id = $arrRet[0]['customer_id']; 
     
    563563     */ 
    564564    function sfGetCustomerPointFromCid($customer_id, $use_point, $add_point) { 
    565         $objQuery = new SC_Query(); 
     565        $objQuery =& SC_Query::getSingletonInstance(); 
    566566        if (USE_POINT !== false) { 
    567567            $arrRet = $objQuery->select("point", "dtb_customer", "customer_id = ?", array($customer_id)); 
     
    582582     */ 
    583583    function sfGetCatTree($parent_category_id, $count_check = false) { 
    584         $objQuery = new SC_Query(); 
     584        $objQuery =& SC_Query::getSingletonInstance(); 
    585585        $col = ""; 
    586586        $col .= " cat.category_id,"; 
     
    626626     */ 
    627627    function sfGetMultiCatTree($product_id, $count_check = false) { 
    628         $objQuery = new SC_Query(); 
     628        $objQuery =& SC_Query::getSingletonInstance(); 
    629629        $col = ""; 
    630630        $col .= " cat.category_id,"; 
     
    675675    function sfGetCatCombName($category_id){ 
    676676        // 商品が属するカテゴリIDを縦に取得 
    677         $objQuery = new SC_Query(); 
     677        $objQuery =& SC_Query::getSingletonInstance(); 
    678678        $arrCatID = $this->sfGetParents($objQuery, "dtb_category", "parent_category_id", "category_id", $category_id); 
    679679        $ConbName = ""; 
     
    699699     */ 
    700700    function sfGetCat($category_id){ 
    701         $objQuery = new SC_Query(); 
     701        $objQuery =& SC_Query::getSingletonInstance(); 
    702702 
    703703        // カテゴリーを取得する 
     
    716716    function sfGetFirstCat($category_id){ 
    717717        // 商品が属するカテゴリIDを縦に取得 
    718         $objQuery = new SC_Query(); 
     718        $objQuery =& SC_Query::getSingletonInstance(); 
    719719        $arrRet = array(); 
    720720        $arrCatID = $this->sfGetParents($objQuery, "dtb_category", "parent_category_id", "category_id", $category_id); 
     
    740740     */ 
    741741    function sfGetCategoryList($addwhere = "", $products_check = false, $head = CATEGORY_HEAD) { 
    742         $objQuery = new SC_Query(); 
     742        $objQuery =& SC_Query::getSingletonInstance(); 
    743743        $where = "del_flg = 0"; 
    744744 
     
    778778     */ 
    779779    function sfGetLevelCatList($parent_zero = true) { 
    780         $objQuery = new SC_Query(); 
     780        $objQuery =& SC_Query::getSingletonInstance(); 
    781781 
    782782        // カテゴリ名リストを取得 
     
    838838                $this->g_category_id = array($category_id); 
    839839            } else if (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && $this->sfIsRecord("dtb_products","product_id", $product_id, $status)) { 
    840                 $objQuery = new SC_Query(); 
     840                $objQuery =& SC_Query::getSingletonInstance(); 
    841841                $where = "product_id = ?"; 
    842842                $category_id = $objQuery->getCol("dtb_product_categories", "category_id", "product_id = ?", array($product_id)); 
     
    862862                        "product_id" => $product_id); 
    863863 
    864         $objQuery = new SC_Query(); 
     864        $objQuery =& SC_Query::getSingletonInstance(); 
    865865 
    866866        // 現在の商品カテゴリを取得 
     
    894894                        "product_id" => $product_id); 
    895895 
    896         $objQuery = new SC_Query(); 
     896        $objQuery =& SC_Query::getSingletonInstance(); 
    897897 
    898898        // 現在の商品カテゴリを取得 
     
    925925        $sqlval = array("category_id" => $category_id, 
    926926                        "product_id" => $product_id); 
    927         $objQuery = new SC_Query(); 
     927        $objQuery =& SC_Query::getSingletonInstance(); 
    928928        $objQuery->delete("dtb_product_categories", 
    929929                          "category_id = ? AND product_id = ?", $sqlval); 
     
    938938     */ 
    939939    function updateProductCategories($arrCategory_id, $product_id) { 
    940         $objQuery = new SC_Query(); 
     940        $objQuery =& SC_Query::getSingletonInstance(); 
    941941 
    942942        // 現在のカテゴリ情報を取得 
     
    10511051     */ 
    10521052    function sfGetChildrenArray($table, $pid_name, $id_name, $id) { 
    1053         $objQuery = new SC_Query(); 
     1053        $objQuery =& SC_Query::getSingletonInstance(); 
    10541054        $col = $pid_name . "," . $id_name; 
    10551055         $arrData = $objQuery->select($col, $table); 
     
    11201120     */ 
    11211121    function sfGetParentsArray($table, $pid_name, $id_name, $id) { 
    1122         $objQuery = new SC_Query(); 
     1122        $objQuery =& SC_Query::getSingletonInstance(); 
    11231123        $col = $pid_name . "," . $id_name; 
    11241124        $arrData = $objQuery->select($col, $table); 
     
    11691169     */ 
    11701170    function sfGetOrderTemp($order_temp_id) { 
    1171         $objQuery = new SC_Query(); 
     1171        $objQuery =& SC_Query::getSingletonInstance(); 
    11721172        $where = "order_temp_id = ?"; 
    11731173        $arrRet = $objQuery->select("*", "dtb_order_temp", $where, array($order_temp_id)); 
     
    11841184     */ 
    11851185    function sfGetIDValueList($table, $keyname, $valname) { 
    1186         $objQuery = new SC_Query(); 
     1186        $objQuery =& SC_Query::getSingletonInstance(); 
    11871187        $col = "$keyname, $valname"; 
    11881188        $objQuery->setWhere("del_flg = 0"); 
     
    12081208     */ 
    12091209    function sfRankUp($table, $colname, $id, $andwhere = "") { 
    1210         $objQuery = new SC_Query(); 
     1210        $objQuery =& SC_Query::getSingletonInstance(); 
    12111211        $objQuery->begin(); 
    12121212        $where = "$colname = ?"; 
     
    12481248     */ 
    12491249    function sfRankDown($table, $colname, $id, $andwhere = "") { 
    1250         $objQuery = new SC_Query(); 
     1250        $objQuery =& SC_Query::getSingletonInstance(); 
    12511251        $objQuery->begin(); 
    12521252        $where = "$colname = ?"; 
     
    12881288     */ 
    12891289    function sfMoveRank($tableName, $keyIdColumn, $keyId, $pos, $where = "") { 
    1290         $objQuery = new SC_Query(); 
     1290        $objQuery =& SC_Query::getSingletonInstance(); 
    12911291        $objQuery->begin(); 
    12921292 
     
    13531353    function sfDeleteRankRecord($table, $colname, $id, $andwhere = "", 
    13541354                                $delete = false) { 
    1355         $objQuery = new SC_Query(); 
     1355        $objQuery =& SC_Query::getSingletonInstance(); 
    13561356        $objQuery->begin(); 
    13571357        // 削除レコードのランクを取得する。 
     
    14491449     */ 
    14501450    function sfGetDelivTime($payment_id = "") { 
    1451         $objQuery = new SC_Query(); 
     1451        $objQuery =& SC_Query::getSingletonInstance(); 
    14521452 
    14531453        $deliv_id = ""; 
     
    14791479        $payment_id = isset($arrData['payment_id']) ? $arrData['payment_id'] : ""; 
    14801480 
    1481         $objQuery = new SC_Query(); 
     1481        $objQuery =& SC_Query::getSingletonInstance(); 
    14821482 
    14831483        $deliv_id = ""; 
     
    15051505            } 
    15061506 
    1507             $objQuery = new SC_Query(); 
     1507            $objQuery =& SC_Query::getSingletonInstance(); 
    15081508            $where = "deliv_id = ? AND pref = ?"; 
    15091509            $arrRet= $objQuery->select("fee", "dtb_delivfee", $where, array($deliv_id, $pref)); 
     
    16111611     */ 
    16121612    function sfIsRecord($table, $col, $arrval, $addwhere = "") { 
    1613         $objQuery = new SC_Query(); 
     1613        $objQuery =& SC_Query::getSingletonInstance(); 
    16141614        $arrCol = split("[, ]", $col); 
    16151615 
     
    16811681                $this->g_maker_id = array($maker_id); 
    16821682            } else if (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && $this->sfIsRecord("dtb_products","product_id", $product_id, $status)) { 
    1683                 $objQuery = new SC_Query(); 
     1683                $objQuery =& SC_Query::getSingletonInstance(); 
    16841684                $where = "product_id = ?"; 
    16851685                $maker_id = $objQuery->getCol("dtb_products", "maker_id", "product_id = ?", array($product_id)); 
     
    17031703     */ 
    17041704    function sfGetMakerList($addwhere = "", $products_check = false) { 
    1705         $objQuery = new SC_Query(); 
     1705        $objQuery =& SC_Query::getSingletonInstance(); 
    17061706        $where = "del_flg = 0"; 
    17071707 
     
    17431743     */ 
    17441744    function lfCalcAllProductsDelivFee(&$arrData, &$objCartSess) { 
    1745         $objQuery = new SC_Query(); 
     1745        $objQuery =& SC_Query::getSingletonInstance(); 
    17461746        $deliv_fee_total = 0; 
    17471747        $max = $objCartSess->getMax(); 
     
    17741774     */ 
    17751775    function sfUpdateOrderNameCol($order_id, $temp_table = false) { 
    1776         $objQuery = new SC_Query(); 
     1776        $objQuery =& SC_Query::getSingletonInstance(); 
    17771777 
    17781778        if ($temp_table) { 
     
    18481848     */ 
    18491849    function sfUpdateOrderStatus($orderId, $newStatus = null, $newAddPoint = null, $newUsePoint = null) { 
    1850         $objQuery = new SC_Query(); 
     1850        $objQuery =& SC_Query::getSingletonInstance(); 
    18511851 
    18521852        $arrOrderOld = $objQuery->getRow('dtb_order', 'status, add_point, use_point, customer_id', 'order_id = ?', array($orderId)); 
     
    19551955    function sfExecSqlByFile($sqlFilePath) { 
    19561956        if (file_exists($sqlFilePath)) { 
    1957             $objQuery = new SC_Query(); 
     1957            $objQuery =& SC_Query::getSingletonInstance(); 
    19581958 
    19591959            $sqls = file_get_contents($sqlFilePath); 
     
    19811981        if (!SC_Utils_Ex::sfIsInt($product_id)) return false; 
    19821982 
    1983         $objQuery  = new SC_Query(); 
     1983        $objQuery =& SC_Query::getSingletonInstance(); 
    19841984        $where = 'product_id = ? AND (classcategory_id1 <> 0 OR classcategory_id2 <> 0)'; 
    19851985        $count = $objQuery->count('dtb_products_class', $where, array($product_id)); 
     
    19941994     */ 
    19951995    function chkCartDown($objCartSess) { 
    1996         $objQuery = new SC_Query(); 
     1996        $objQuery =& SC_Query::getSingletonInstance(); 
    19971997        $down = false; 
    19981998        $nodown = false; 
Note: See TracChangeset for help on using the changeset viewer.