Ignore:
Timestamp:
2013/08/24 23:33:52 (11 years ago)
Author:
kimoto
Message:

#2043 typo修正・ソース整形・ソースコメントの改善 for 2.13.0
PHP4的な書き方の修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_13-dev/data/class/SC_CartSession.php

    r23085 r23124  
    3131{ 
    3232    /** ユニークIDを指定する. */ 
    33     var $key_tmp; 
     33    public $key_tmp; 
    3434 
    3535    /** カートのセッション変数. */ 
    36     var $cartSession; 
     36    public $cartSession; 
    3737 
    3838    /* コンストラクタ */ 
    39     function __construct($cartKey = 'cart') 
     39    public function __construct($cartKey = 'cart') 
    4040    { 
    4141        if (!isset($_SESSION[$cartKey])) { 
     
    4646 
    4747    // 商品購入処理中のロック 
    48     function saveCurrentCart($key_tmp, $productTypeId) 
     48    public function saveCurrentCart($key_tmp, $productTypeId) 
    4949    { 
    5050        $this->key_tmp = 'savecart_' . $key_tmp; 
     
    6262 
    6363    // 商品購入中の変更があったかをチェックする。 
    64     function getCancelPurchase($productTypeId) 
     64    public function getCancelPurchase($productTypeId) 
    6565    { 
    6666        $ret = isset($this->cartSession[$productTypeId]['cancel_purchase']) 
     
    7272 
    7373    // 購入処理中に商品に変更がなかったかを判定 
    74     function checkChangeCart($productTypeId) 
     74    public function checkChangeCart($productTypeId) 
    7575    { 
    7676        $change = false; 
     
    100100 
    101101    // 次に割り当てるカートのIDを取得する 
    102     function getNextCartID($productTypeId) 
     102    public function getNextCartID($productTypeId) 
    103103    { 
    104104        $count = array(); 
     
    111111 
    112112    // 値のセット 
    113     function setProductValue($id, $key, $val, $productTypeId) 
     113    public function setProductValue($id, $key, $val, $productTypeId) 
    114114    { 
    115115        $max = $this->getMax($productTypeId); 
     
    124124 
    125125    // カート内商品の最大要素番号を取得する。 
    126     function getMax($productTypeId) 
     126    public function getMax($productTypeId) 
    127127    { 
    128128        $max = 0; 
     
    141141 
    142142    // カート内商品数量の合計 
    143     function getTotalQuantity($productTypeId) 
     143    public function getTotalQuantity($productTypeId) 
    144144    { 
    145145        $total = 0; 
     
    153153 
    154154    // 全商品の合計価格 
    155     function getAllProductsTotal($productTypeId, $pref_id = 0, $country_id = 0) 
     155    public function getAllProductsTotal($productTypeId, $pref_id = 0, $country_id = 0) 
    156156    { 
    157157        // 税込み合計 
     
    176176            $total+= ($incTax * $quantity); 
    177177        } 
     178 
    178179        return $total; 
    179180    } 
    180181 
    181182    // 全商品の合計税金 
    182     function getAllProductsTax($productTypeId, $pref_id = 0, $country_id = 0) 
     183    public function getAllProductsTax($productTypeId, $pref_id = 0, $country_id = 0) 
    183184    { 
    184185        // 税合計 
     
    200201 
    201202    // 全商品の合計ポイント 
    202     function getAllProductsPoint($productTypeId) 
     203    public function getAllProductsPoint($productTypeId) 
    203204    { 
    204205        // ポイント合計 
     
    227228 
    228229    // カートへの商品追加 
    229     function addProduct($product_class_id, $quantity) 
     230    public function addProduct($product_class_id, $quantity) 
    230231    { 
    231232        $objProduct = new SC_Product_Ex(); 
     
    251252 
    252253    // 前頁のURLを記録しておく 
    253     function setPrevURL($url, $excludePaths = array()) 
     254    public function setPrevURL($url, $excludePaths = array()) 
    254255    { 
    255256        // 前頁として記録しないページを指定する。 
     
    273274 
    274275    // 前頁のURLを取得する 
    275     function getPrevURL() 
     276    public function getPrevURL() 
    276277    { 
    277278        return isset($_SESSION['prev_url']) ? $_SESSION['prev_url'] : ''; 
     
    279280 
    280281    // キーが一致した商品の削除 
    281     function delProductKey($keyname, $val, $productTypeId) 
     282    public function delProductKey($keyname, $val, $productTypeId) 
    282283    { 
    283284        $max = count($this->cartSession[$productTypeId]); 
     
    289290    } 
    290291 
    291     function setValue($key, $val, $productTypeId) 
     292    public function setValue($key, $val, $productTypeId) 
    292293    { 
    293294        $this->cartSession[$productTypeId][$key] = $val; 
    294295    } 
    295296 
    296     function getValue($key, $productTypeId) 
     297    public function getValue($key, $productTypeId) 
    297298    { 
    298299        return $this->cartSession[$productTypeId][$key]; 
     
    303304     * productsClass項目から、不必要な項目を削除する。 
    304305     */ 
    305     function adjustSessionProductsClass(&$arrProductsClass) 
     306    public function adjustSessionProductsClass(&$arrProductsClass) 
    306307    { 
    307308        $arrNecessaryItems = array( 
     
    334335     * getCartList用にcartSession情報をセットする 
    335336     * 
    336      * @param integer $product_type_id 商品種別ID 
    337      * @param integer $key 
     337     * @param  integer $product_type_id 商品種別ID 
     338     * @param  integer $key 
    338339     * @return void 
    339340     * 
    340341     * MEMO: せっかく一回だけ読み込みにされてますが、税率対応の関係でちょっと保留 
    341342     */ 
    342     function setCartSession4getCartList($productTypeId, $key) 
     343    public function setCartSession4getCartList($productTypeId, $key) 
    343344    { 
    344345        $objProduct = new SC_Product_Ex(); 
     
    367368     * 商品種別ごとにカート内商品の一覧を取得する. 
    368369     * 
    369      * @param integer $productTypeId 商品種別ID 
    370      * @param integer $pref_id 税金計算用注文者都道府県ID 
    371      * @param integer $country_id 税金計算用注文者国ID 
    372      * @return array カート内商品一覧の配列 
    373      */ 
    374     function getCartList($productTypeId, $pref_id = 0, $country_id = 0) 
     370     * @param  integer $productTypeId 商品種別ID 
     371     * @param  integer $pref_id      税金計算用注文者都道府県ID 
     372     * @param  integer $country_id    税金計算用注文者国ID 
     373     * @return array   カート内商品一覧の配列 
     374     */ 
     375    public function getCartList($productTypeId, $pref_id = 0, $country_id = 0) 
    375376    { 
    376377        $objProduct = new SC_Product_Ex(); 
     
    443444     * @return array 全てのカートの内容 
    444445     */ 
    445     function getAllCartList() 
     446    public function getAllCartList() 
    446447    { 
    447448        $results = array(); 
     
    463464     * カート内にある商品規格IDを全て取得する. 
    464465     * 
    465      * @param integer $productTypeId 商品種別ID 
    466      * @return array 商品規格ID の配列 
    467      */ 
    468     function getAllProductClassID($productTypeId) 
     466     * @param  integer $productTypeId 商品種別ID 
     467     * @return array   商品規格ID の配列 
     468     */ 
     469    public function getAllProductClassID($productTypeId) 
    469470    { 
    470471        $max = $this->getMax($productTypeId); 
     
    482483     * 商品種別ID を指定して, カート内の商品を全て削除する. 
    483484     * 
    484      * @param integer $productTypeId 商品種別ID 
     485     * @param  integer $productTypeId 商品種別ID 
    485486     * @return void 
    486487     */ 
    487     function delAllProducts($productTypeId) 
     488    public function delAllProducts($productTypeId) 
    488489    { 
    489490        $max = $this->getMax($productTypeId); 
     
    494495 
    495496    // 商品の削除 
    496     function delProduct($cart_no, $productTypeId) 
     497    public function delProduct($cart_no, $productTypeId) 
    497498    { 
    498499        $max = $this->getMax($productTypeId); 
     
    505506 
    506507    // 数量の増加 
    507     function upQuantity($cart_no, $productTypeId) 
     508    public function upQuantity($cart_no, $productTypeId) 
    508509    { 
    509510        $quantity = $this->getQuantity($cart_no, $productTypeId); 
     
    514515 
    515516    // 数量の減少 
    516     function downQuantity($cart_no, $productTypeId) 
     517    public function downQuantity($cart_no, $productTypeId) 
    517518    { 
    518519        $quantity = $this->getQuantity($cart_no, $productTypeId); 
     
    525526     * カート番号と商品種別IDを指定して, 数量を取得する. 
    526527     * 
    527      * @param integer $cart_no カート番号 
    528      * @param integer $productTypeId 商品種別ID 
     528     * @param  integer $cart_no      カート番号 
     529     * @param  integer $productTypeId 商品種別ID 
    529530     * @return integer 該当商品規格の数量 
    530531     */ 
    531     function getQuantity($cart_no, $productTypeId) 
     532    public function getQuantity($cart_no, $productTypeId) 
    532533    { 
    533534        $max = $this->getMax($productTypeId); 
     
    542543     * カート番号と商品種別IDを指定して, 数量を設定する. 
    543544     * 
    544      * @param integer $quantity 設定する数量 
    545      * @param integer $cart_no カート番号 
     545     * @param integer $quantity      設定する数量 
     546     * @param integer $cart_no       カート番号 
    546547     * @param integer $productTypeId 商品種別ID 
    547548     * @retrun void 
    548549     */ 
    549     function setQuantity($quantity, $cart_no, $productTypeId) 
     550    public function setQuantity($quantity, $cart_no, $productTypeId) 
    550551    { 
    551552        $max = $this->getMax($productTypeId); 
     
    560561     * カート番号と商品種別IDを指定して, 商品規格IDを取得する. 
    561562     * 
    562      * @param integer $cart_no カート番号 
    563      * @param integer $productTypeId 商品種別ID 
     563     * @param  integer $cart_no      カート番号 
     564     * @param  integer $productTypeId 商品種別ID 
    564565     * @return integer 商品規格ID 
    565566     */ 
    566     function getProductClassId($cart_no, $productTypeId) 
     567    public function getProductClassId($cart_no, $productTypeId) 
    567568    { 
    568569        for ($i = 0; $i < count($this->cartSession[$productTypeId]); $i++) { 
     
    584585     * 4. 在庫数チェック 
    585586     * 
    586      * @param string $productTypeId 商品種別ID 
     587     * @param  string $productTypeId 商品種別ID 
    587588     * @return string エラーが発生した場合はエラーメッセージ 
    588589     */ 
    589     function checkProducts($productTypeId) 
     590    public function checkProducts($productTypeId) 
    590591    { 
    591592        $objProduct = new SC_Product_Ex(); 
     
    642643     * 送料無料条件を満たすかどうかチェックする 
    643644     * 
    644      * @param integer $productTypeId 商品種別ID 
     645     * @param  integer $productTypeId 商品種別ID 
    645646     * @return boolean 送料無料の場合 true 
    646647     */ 
    647     function isDelivFree($productTypeId) 
     648    public function isDelivFree($productTypeId) 
    648649    { 
    649650        $objDb = new SC_Helper_DB_Ex(); 
     
    685686     * - add_point: 加算ポイント 
    686687     * 
    687      * @param integer $productTypeId 商品種別ID 
    688      * @param SC_Customer $objCustomer ログイン中の SC_Customer インスタンス 
    689      * @param integer $use_point 今回使用ポイント 
    690      * @param integer|array $deliv_pref 配送先都道府県ID. 
     688     * @param integer       $productTypeId 商品種別ID 
     689     * @param SC_Customer   $objCustomer  ログイン中の SC_Customer インスタンス 
     690     * @param integer       $use_point    今回使用ポイント 
     691     * @param integer|array $deliv_pref    配送先都道府県ID. 
    691692                                        複数に配送する場合は都道府県IDの配列 
    692      * @param integer $charge 手数料 
    693      * @param integer $discount 値引き 
    694      * @param integer $deliv_id 配送業者ID 
    695      * @param integer $order_pref 注文者の都道府県ID 
    696      * @param integer $order_country_id 注文者の国 
    697      * @return array カートの計算結果の配列 
    698      */ 
    699     function calculate($productTypeId, &$objCustomer, $use_point = 0, 
     693     * @param  integer $charge          手数料 
     694     * @param  integer $discount        値引き 
     695     * @param  integer $deliv_id        配送業者ID 
     696     * @param  integer $order_pref      注文者の都道府県ID 
     697     * @param  integer $order_country_id 注文者の国 
     698     * @return array   カートの計算結果の配列 
     699     */ 
     700    public function calculate($productTypeId, &$objCustomer, $use_point = 0, 
    700701        $deliv_pref = '', $charge = 0, $discount = 0, $deliv_id = 0, 
    701702        $order_pref = 0, $order_country_id = 0 
     
    761762     * @return array 商品種別IDの配列 
    762763     */ 
    763     function getKeys() 
     764    public function getKeys() 
    764765    { 
    765766        $keys = array_keys($this->cartSession); 
     
    778779     * カートに設定された現在のキー(商品種別ID)を登録する. 
    779780     * 
    780      * @param integer $key 商品種別ID 
     781     * @param  integer $key 商品種別ID 
    781782     * @return void 
    782783     */ 
    783     function registerKey($key) 
     784    public function registerKey($key) 
    784785    { 
    785786        $_SESSION['cartKey'] = $key; 
     
    791792     * @return void 
    792793     */ 
    793     function unsetKey() 
     794    public function unsetKey() 
    794795    { 
    795796        unset($_SESSION['cartKey']); 
     
    801802     * @return integer 商品種別ID 
    802803     */ 
    803     function getKey() 
     804    public function getKey() 
    804805    { 
    805806        return $_SESSION['cartKey']; 
     
    811812     * @return boolean カートが複数商品種別の場合 true 
    812813     */ 
    813     function isMultiple() 
     814    public function isMultiple() 
    814815    { 
    815816        return count($this->getKeys()) > 1; 
     
    819820     * 引数の商品種別の商品がカートに含まれるかどうか. 
    820821     * 
    821      * @param integer $product_type_id 商品種別ID 
     822     * @param  integer $product_type_id 商品種別ID 
    822823     * @return boolean 指定の商品種別がカートに含まれる場合 true 
    823824     */ 
    824     function hasProductType($product_type_id) 
     825    public function hasProductType($product_type_id) 
    825826    { 
    826827        return in_array($product_type_id, $this->getKeys()); 
Note: See TracChangeset for help on using the changeset viewer.