- Timestamp:
- 2013/03/01 10:01:07 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/helper/SC_Helper_Category.php
r22588 r22589 31 31 class SC_Helper_Category 32 32 { 33 private $count_check; 34 35 /** 36 * コンストラクター 37 * 38 * @param boolean $count_check 登録商品数をチェックする場合はtrue 39 */ 40 function __construct($count_check = FALSE) 41 { 42 $this->count_check = $count_check; 43 } 44 33 45 /** 34 46 * カテゴリー一覧の取得. 35 47 * 36 * @param boolean $count_check 登録商品数をチェックする場合はtrue37 48 * @param boolean $cid_to_key 配列のキーをカテゴリーIDにする場合はtrue 38 49 * @return array カテゴリー一覧の配列 39 50 */ 40 public function getList($c ount_check = FALSE, $cid_to_key = FALSE)51 public function getList($cid_to_key = FALSE) 41 52 { 42 53 $objQuery =& SC_Query_Ex::getSingletonInstance(); … … 44 55 $from = 'dtb_category left join dtb_category_total_count ON dtb_category.category_id = dtb_category_total_count.category_id'; 45 56 // 登録商品数のチェック 46 if ($ count_check) {57 if ($this->count_check) { 47 58 $where = 'del_flg = 0 AND product_count > 0'; 48 59 } else { … … 54 65 if ($cid_to_key) { 55 66 // 配列のキーをカテゴリーIDに 56 $arrTmp = array(); 57 foreach ($arrCategory as $category) { 58 $arrTmp[$category['category_id']] = $category; 59 } 60 $arrCategory =& $arrTmp; 61 unset($arrTmp); 67 $arrCategory = SC_Utils_Ex::makeArrayIDToKey('category_id', $arrCategory); 62 68 } 63 69 … … 68 74 * カテゴリーツリーの取得. 69 75 * 70 * @param boolean $count_check 登録商品数をチェックする場合はtrue71 76 * @return type 72 77 */ 73 public function getTree( $count_check = FALSE)78 public function getTree() 74 79 { 75 $arrList = $this->getList( $count_check);80 $arrList = $this->getList(); 76 81 $arrTree = SC_Utils_Ex::buildTree('category_id', 'parent_category_id', LEVEL_MAX, $arrList); 77 82 return $arrTree;
Note: See TracChangeset
for help on using the changeset viewer.