Ignore:
Timestamp:
2014/05/21 13:02:52 (10 years ago)
Author:
pineray
Message:

#2554 カテゴリー更新にツリーが連動しない不具合を修正.

File:
1 edited

Legend:

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

    r23436 r23437  
    6767     * カテゴリー一覧の取得. 
    6868     * 
    69      * @param  boolean $cid_to_key 配列のキーをカテゴリーIDにする場合はtrue 
     69     * @param bool $cid_to_key 配列のキーをカテゴリーIDにする場合はtrue 
     70     * @param bool $reset スタティック変数をリセットする場合はtrue 
    7071     * @return array   カテゴリー一覧の配列 
    7172     */ 
    72     public function getList($cid_to_key = FALSE) 
     73    public function getList($cid_to_key = FALSE, $reset = FALSE) 
    7374    { 
    7475        static $arrCategory = array(), $cidIsKey = array(); 
     76 
     77        if ($reset) { 
     78            $arrCategory = array(); 
     79            $cidIsKey = array(); 
     80        } 
    7581 
    7682        if (!isset($arrCategory[$this->count_check])) { 
     
    105111     * カテゴリーツリーの取得. 
    106112     * 
     113     * @param bool $reset スタティック変数をリセットする場合はtrue 
    107114     * @return array 
    108115     */ 
    109     public function getTree() 
     116    public function getTree($reset = false) 
    110117    { 
    111118        static $arrTree = array(); 
     119 
     120        if ($reset) { 
     121            $arrTree = array(); 
     122        } 
     123 
    112124        if (!isset($arrTree[$this->count_check])) { 
    113             $arrList = $this->getList(); 
     125            $arrList = $this->getList(false, $reset); 
    114126            $arrTree[$this->count_check] = SC_Utils_Ex::buildTree('category_id', 'parent_category_id', LEVEL_MAX, $arrList); 
    115127        } 
Note: See TracChangeset for help on using the changeset viewer.