Ignore:
Timestamp:
2007/08/01 12:21:06 (17 years ago)
Author:
nanasess
Message:

slib.php のクラス化対応

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/util/SC_Utils.php

    r15141 r15155  
    486486            // sfErrorHeader('>> referrerが無効になっています。'); 
    487487        } else { 
    488             $domain  = sfIsHTTPS() ? SSL_URL : SITE_URL; 
     488            $domain  = SC_Utils::sfIsHTTPS() ? SSL_URL : SITE_URL; 
    489489            $pattern = sprintf('|^%s.*|', $domain); 
    490490            $referer = $_SERVER['HTTP_REFERER']; 
     
    934934        for($cnt = 0; $cnt < $max; $cnt++) { 
    935935            if($keysize != "") { 
    936                 $key = sfCutString($arrList[$cnt][$keyname], $keysize); 
     936                $key = $this->sfCutString($arrList[$cnt][$keyname], $keysize); 
    937937            } else { 
    938938                $key = $arrList[$cnt][$keyname]; 
     
    959959        for($cnt = 0; $cnt < $max; $cnt++) { 
    960960            if($keysize != "") { 
    961                 $key = sfCutString($arrList[$cnt][$keyname], $keysize); 
     961                $key = $this->sfCutString($arrList[$cnt][$keyname], $keysize); 
    962962            } else { 
    963963                $key = $arrList[$cnt][$keyname]; 
     
    12311231    /* 子IDの配列を返す */ 
    12321232    function sfGetChildsID($table, $pid_name, $id_name, $id) { 
    1233         $arrRet = sfGetChildrenArray($table, $pid_name, $id_name, $id); 
     1233        $arrRet = SC_Utils::sfGetChildrenArray($table, $pid_name, $id_name, $id); 
    12341234        return $arrRet; 
    12351235    } 
     
    13231323    /* ポイント付与 */ 
    13241324    function sfPrePoint($price, $point_rate, $rule = POINT_RULE, $product_id = "") { 
    1325         if(sfIsInt($product_id)) { 
     1325        if(SC_Utils::sfIsInt($product_id)) { 
    13261326            $objQuery = new SC_Query(); 
    13271327            $where = "now() >= cast(start_date as date) AND "; 
     
    19991999            $category_id = (int) $category_id; 
    20002000            $product_id = (int) $product_id; 
    2001             if(SC_Utils::sfIsInt($category_id) && sfIsRecord("dtb_category","category_id", $category_id)) { 
     2001            if(SC_Utils_Ex::sfIsInt($category_id) && SC_Utils_Ex::sfIsRecord("dtb_category","category_id", $category_id)) { 
    20022002                $g_category_id = $category_id; 
    2003             } else if (SC_Utils::sfIsInt($product_id) && sfIsRecord("dtb_products","product_id", $product_id, "status = 1")) { 
     2003            } else if (SC_Utils_Ex::sfIsInt($product_id) && SC_Utils_Ex::sfIsRecord("dtb_products","product_id", $product_id, "status = 1")) { 
    20042004                $objQuery = new SC_Query(); 
    20052005                $where = "product_id = ?"; 
     
    20272027            if($_GET['product_id'] != "" || $_GET['category_id'] != "") { 
    20282028                // 選択中のカテゴリIDを判定する 
    2029                 $category_id = sfGetCategoryId($_GET['product_id'], $_GET['category_id']); 
     2029                $category_id = SC_Utils::sfGetCategoryId($_GET['product_id'], $_GET['category_id']); 
    20302030                // ROOTカテゴリIDの取得 
    2031                  $arrRet = sfGetParents($objQuery, 'dtb_category', 'parent_category_id', 'category_id', $category_id); 
     2031                 $arrRet = SC_Utils::sfGetParents($objQuery, 'dtb_category', 'parent_category_id', 'category_id', $category_id); 
    20322032                 $root_id = $arrRet[0]; 
    20332033            } else { 
     
    20432043    function sfGetCatWhere($category_id) { 
    20442044        // 子カテゴリIDの取得 
    2045         $arrRet = sfGetChildsID("dtb_category", "parent_category_id", "category_id", $category_id); 
     2045        $arrRet = SC_Utils::sfGetChildsID("dtb_category", "parent_category_id", "category_id", $category_id); 
    20462046        $tmp_where = ""; 
    20472047        foreach ($arrRet as $val) { 
     
    25582558        $arrChildren[] = $id; 
    25592559 
    2560         $arrRet = sfGetChildrenArraySub($arrData, $pid_name, $id_name, $arrPID); 
     2560        $arrRet = SC_Utils::sfGetChildrenArraySub($arrData, $pid_name, $id_name, $arrPID); 
    25612561 
    25622562        while(count($arrRet) > 0) { 
    25632563            $arrChildren = array_merge($arrChildren, $arrRet); 
    2564             $arrRet = sfGetChildrenArraySub($arrData, $pid_name, $id_name, $arrRet); 
     2564            $arrRet = SC_Utils::sfGetChildrenArraySub($arrData, $pid_name, $id_name, $arrRet); 
    25652565        } 
    25662566 
     
    27202720        $objQuery = new SC_Query(); 
    27212721        $arrRet = array(); 
    2722         $arrCatID = sfGetParents($objQuery, "dtb_category", "parent_category_id", "category_id", $category_id); 
     2722        $arrCatID = SC_Utils_Ex::sfGetParents($objQuery, "dtb_category", "parent_category_id", "category_id", $category_id); 
    27232723        $arrRet['id'] = $arrCatID[0]; 
    27242724 
Note: See TracChangeset for help on using the changeset viewer.