Ignore:
Timestamp:
2014/05/29 14:40:57 (10 years ago)
Author:
pineray
Message:

#2515 無駄な処理を改善する for 2.13.3

カテゴリーID取得部分の処理を整理.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_13-dev/data/class/pages/products/LC_Page_Products_List.php

    r23407 r23459  
    185185     * カテゴリIDの取得 
    186186     * 
    187      * @return integer カテゴリID 
     187     * @param int $category_id 
     188     * @return integer|void カテゴリID 
    188189     */ 
    189190    public function lfGetCategoryId($category_id) 
     
    193194 
    194195        // 正当性チェック 
    195         if (!SC_Utils_Ex::sfIsInt($category_id) 
    196             || SC_Utils_Ex::sfIsZeroFilling($category_id) 
    197             || !SC_Helper_DB_Ex::sfIsRecord('dtb_category', 'category_id', (array) $category_id, 'del_flg = 0') 
    198             ) { 
     196        $objCategory = new SC_Helper_Category_Ex(); 
     197        if ($objCategory->isValidCategoryId($category_id)) { 
     198            return $category_id; 
     199        } else { 
    199200            SC_Utils_Ex::sfDispSiteError(CATEGORY_NOT_FOUND); 
    200201        } 
    201  
    202         // 指定されたカテゴリIDを元に正しいカテゴリIDを取得する。 
    203         $arrCategory_id = SC_Helper_DB_Ex::sfGetCategoryId('', $category_id); 
    204  
    205         if (empty($arrCategory_id)) { 
    206             SC_Utils_Ex::sfDispSiteError(CATEGORY_NOT_FOUND); 
    207         } 
    208  
    209         return $arrCategory_id[0]; 
    210202    } 
    211203 
Note: See TracChangeset for help on using the changeset viewer.