- Timestamp:
- 2013/03/05 09:21:53 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/helper/SC_Helper_Category.php
r22597 r22603 71 71 public function getList($cid_to_key = FALSE) 72 72 { 73 static $arrCategory = array() ;73 static $arrCategory = array(), $cidIsKey = array(); 74 74 75 75 if (!isset($arrCategory[$this->count_check])) { … … 90 90 91 91 if ($cid_to_key) { 92 // 配列のキーをカテゴリーIDに 93 return SC_Utils_Ex::makeArrayIDToKey('category_id', $arrCategory[$this->count_check]); 92 if (!isset($cidIsKey[$this->count_check])) { 93 // 配列のキーをカテゴリーIDに 94 $cidIsKey[$this->count_check] = SC_Utils_Ex::makeArrayIDToKey('category_id', $arrCategory[$this->count_check]); 95 } 96 return $cidIsKey[$this->count_check]; 94 97 } 95 98 … … 104 107 public function getTree() 105 108 { 106 $arrList = $this->getList(); 107 $arrTree = SC_Utils_Ex::buildTree('category_id', 'parent_category_id', LEVEL_MAX, $arrList); 108 return $arrTree; 109 static $arrTree = array(); 110 if (!isset($arrTree[$this->count_check])) { 111 $arrList = $this->getList(); 112 $arrTree[$this->count_check] = SC_Utils_Ex::buildTree('category_id', 'parent_category_id', LEVEL_MAX, $arrList); 113 } 114 return $arrTree[$this->count_check]; 109 115 } 110 116 … … 118 124 public function getTreeTrail($category_id, $id_only = TRUE) 119 125 { 120 $arrCategory = $this->getList( );121 $arrTrailID = SC_Utils_Ex::getTreeTrail($category_id, 'category_id', 'parent_category_id', $arrCategory, 0, $id_only);126 $arrCategory = $this->getList(TRUE); 127 $arrTrailID = SC_Utils_Ex::getTreeTrail($category_id, 'category_id', 'parent_category_id', $arrCategory, TRUE, 0, $id_only); 122 128 return $arrTrailID; 123 129 }
Note: See TracChangeset
for help on using the changeset viewer.