Ignore:
Timestamp:
2012/02/11 05:48:00 (12 years ago)
Author:
Seasoft
Message:

#1613 (ソース整形・ソースコメントの改善)

  • Zend Framework PHP 標準コーディング規約への準拠を高めた
File:
1 edited

Legend:

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

    r21479 r21481  
    137137                $arrRet = $objQuery->select('*', 'dtb_baseinfo'); 
    138138            } else { 
    139                 $arrRet = $objQuery->select($col, "dtb_baseinfo"); 
     139                $arrRet = $objQuery->select($col, 'dtb_baseinfo'); 
    140140            } 
    141141 
     
    158158        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    159159 
    160         return $objQuery->count("dtb_baseinfo"); 
     160        return $objQuery->count('dtb_baseinfo'); 
    161161    } 
    162162 
     
    212212    function sfGetRollbackPoint($order_id, $use_point, $add_point, $order_status) { 
    213213        $objQuery = new SC_Query_Ex(); 
    214         $arrRet = $objQuery->select("customer_id", "dtb_order", "order_id = ?", array($order_id)); 
     214        $arrRet = $objQuery->select('customer_id', 'dtb_order', "order_id = ?", array($order_id)); 
    215215        $customer_id = $arrRet[0]['customer_id']; 
    216216        if ($customer_id != "" && $customer_id >= 1) { 
    217             $arrRet = $objQuery->select('point', "dtb_customer", "customer_id = ?", array($customer_id)); 
     217            $arrRet = $objQuery->select('point', 'dtb_customer', "customer_id = ?", array($customer_id)); 
    218218            $point = $arrRet[0]['point']; 
    219219            $rollback_point = $arrRet[0]['point']; 
     
    361361        // 商品が属するカテゴリIDを縦に取得 
    362362        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    363         $arrCatID = $this->sfGetParents("dtb_category", "parent_category_id", "category_id", $category_id); 
     363        $arrCatID = $this->sfGetParents('dtb_category', 'parent_category_id', 'category_id', $category_id); 
    364364        $ConbName = ""; 
    365365 
     
    403403        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    404404        $arrRet = array(); 
    405         $arrCatID = $this->sfGetParents("dtb_category", "parent_category_id", "category_id", $category_id); 
     405        $arrCatID = $this->sfGetParents('dtb_category', 'parent_category_id', 'category_id', $category_id); 
    406406        $arrRet['id'] = $arrCatID[0]; 
    407407 
     
    440440        } else { 
    441441            $col = "category_id, category_name, level"; 
    442             $from = "dtb_category"; 
     442            $from = 'dtb_category'; 
    443443        } 
    444444 
     
    469469        $where = "del_flg = 0"; 
    470470        $objQuery->setOption("ORDER BY level"); 
    471         $arrRet = $objQuery->select($col, "dtb_category", $where); 
     471        $arrRet = $objQuery->select($col, 'dtb_category', $where); 
    472472        $arrCatName = array(); 
    473473        foreach ($arrRet as $arrTmp) { 
     
    481481        $where = "del_flg = 0"; 
    482482        $objQuery->setOption("ORDER BY rank DESC"); 
    483         $arrRet = $objQuery->select($col, "dtb_category", $where); 
     483        $arrRet = $objQuery->select($col, 'dtb_category', $where); 
    484484        $max = count($arrRet); 
    485485 
     
    517517        $category_id = (int) $category_id; 
    518518        $product_id = (int) $product_id; 
    519         if (SC_Utils_Ex::sfIsInt($category_id) && $category_id != 0 && SC_Helper_DB_Ex::sfIsRecord("dtb_category","category_id", $category_id)) { 
     519        if (SC_Utils_Ex::sfIsInt($category_id) && $category_id != 0 && SC_Helper_DB_Ex::sfIsRecord('dtb_category','category_id', $category_id)) { 
    520520            $category_id = array($category_id); 
    521         } else if (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && SC_Helper_DB_Ex::sfIsRecord("dtb_products","product_id", $product_id, $status)) { 
     521        } else if (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && SC_Helper_DB_Ex::sfIsRecord('dtb_products','product_id', $product_id, $status)) { 
    522522            $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    523523            $where = "product_id = ?"; 
    524             $category_id = $objQuery->getCol("category_id", "dtb_product_categories", "product_id = ?", array($product_id)); 
     524            $category_id = $objQuery->getCol('category_id', 'dtb_product_categories', "product_id = ?", array($product_id)); 
    525525        } else { 
    526526            // 不正な場合は、空の配列を返す。 
     
    539539    function addProductBeforCategories($category_id, $product_id) { 
    540540 
    541         $sqlval = array("category_id" => $category_id, 
    542                         "product_id" => $product_id); 
     541        $sqlval = array('category_id' => $category_id, 
     542                        'product_id' => $product_id); 
    543543 
    544544        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    546546        // 現在の商品カテゴリを取得 
    547547        $arrCat = $objQuery->select("product_id, category_id, rank", 
    548                                     "dtb_product_categories", 
     548                                    'dtb_product_categories', 
    549549                                    "category_id = ?", 
    550550                                    array($category_id)); 
    551551 
    552         $max = "0"; 
     552        $max = '0'; 
    553553        foreach ($arrCat as $val) { 
    554554            // 同一商品が存在する場合は登録しない 
    555             if ($val["product_id"] == $product_id) { 
     555            if ($val['product_id'] == $product_id) { 
    556556                return; 
    557557            } 
     
    560560        } 
    561561        $sqlval['rank'] = $max + 1; 
    562         $objQuery->insert("dtb_product_categories", $sqlval); 
     562        $objQuery->insert('dtb_product_categories', $sqlval); 
    563563    } 
    564564 
     
    571571     */ 
    572572    function addProductAfterCategories($category_id, $product_id) { 
    573         $sqlval = array("category_id" => $category_id, 
    574                         "product_id" => $product_id); 
     573        $sqlval = array('category_id' => $category_id, 
     574                        'product_id' => $product_id); 
    575575 
    576576        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     
    578578        // 現在の商品カテゴリを取得 
    579579        $arrCat = $objQuery->select("product_id, category_id, rank", 
    580                                     "dtb_product_categories", 
     580                                    'dtb_product_categories', 
    581581                                    "category_id = ?", 
    582582                                    array($category_id)); 
     
    585585        foreach ($arrCat as $val) { 
    586586            // 同一商品が存在する場合は登録しない 
    587             if ($val["product_id"] == $product_id) { 
     587            if ($val['product_id'] == $product_id) { 
    588588                return; 
    589589            } 
     
    592592        } 
    593593        $sqlval['rank'] = $min; 
    594         $objQuery->insert("dtb_product_categories", $sqlval); 
     594        $objQuery->insert('dtb_product_categories', $sqlval); 
    595595    } 
    596596 
     
    604604    function removeProductByCategories($category_id, $product_id) { 
    605605        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    606         $objQuery->delete("dtb_product_categories", 
     606        $objQuery->delete('dtb_product_categories', 
    607607                          "category_id = ? AND product_id = ?", array($category_id, $product_id)); 
    608608    } 
     
    620620        // 現在のカテゴリ情報を取得 
    621621        $arrCurrentCat = $objQuery->select("product_id, category_id, rank", 
    622                                            "dtb_product_categories", 
     622                                           'dtb_product_categories', 
    623623                                           "product_id = ?", 
    624624                                           array($product_id)); 
     
    628628 
    629629            // 登録しないカテゴリを削除 
    630             if (!in_array($val["category_id"], $arrCategory_id)) { 
    631                 $this->removeProductByCategories($val["category_id"], $product_id); 
     630            if (!in_array($val['category_id'], $arrCategory_id)) { 
     631                $this->removeProductByCategories($val['category_id'], $product_id); 
    632632            } 
    633633        } 
     
    897897        $ret = $id; 
    898898 
    899         while ($ret != "0" && !SC_Utils_Ex::isBlank($ret)) { 
     899        while ($ret != '0' && !SC_Utils_Ex::isBlank($ret)) { 
    900900            $arrParents[] = $ret; 
    901901            $ret = SC_Helper_DB_Ex::sfGetParentsArraySub($table, $pid_name, $id_name, $ret); 
     
    928928    function sfGetCatWhere($category_id) { 
    929929        // 子カテゴリIDの取得 
    930         $arrRet = SC_Helper_DB_Ex::sfGetChildrenArray("dtb_category", "parent_category_id", "category_id", $category_id); 
     930        $arrRet = SC_Helper_DB_Ex::sfGetChildrenArray('dtb_category', 'parent_category_id', 'category_id', $category_id); 
    931931 
    932932        $where = "category_id IN (" . implode(',', array_fill(0, count($arrRet), '?')) . ")"; 
     
    13111311            $maker_id = (int) $maker_id; 
    13121312            $product_id = (int) $product_id; 
    1313             if (SC_Utils_Ex::sfIsInt($maker_id) && $maker_id != 0 && $this->sfIsRecord("dtb_maker","maker_id", $maker_id)) { 
     1313            if (SC_Utils_Ex::sfIsInt($maker_id) && $maker_id != 0 && $this->sfIsRecord('dtb_maker','maker_id', $maker_id)) { 
    13141314                $this->g_maker_id = array($maker_id); 
    1315             } else if (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && $this->sfIsRecord("dtb_products","product_id", $product_id, $status)) { 
     1315            } else if (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && $this->sfIsRecord('dtb_products','product_id', $product_id, $status)) { 
    13161316                $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    13171317                $where = "product_id = ?"; 
    1318                 $maker_id = $objQuery->getCol("maker_id", "dtb_products", "product_id = ?", array($product_id)); 
     1318                $maker_id = $objQuery->getCol('maker_id', 'dtb_products', "product_id = ?", array($product_id)); 
    13191319                $this->g_maker_id = $maker_id; 
    13201320            } else { 
     
    13511351        } else { 
    13521352            $col = "maker_id, name"; 
    1353             $from = "dtb_maker"; 
     1353            $from = 'dtb_maker'; 
    13541354        } 
    13551355 
Note: See TracChangeset for help on using the changeset viewer.