protected function addCategoryData($iCategoryID, $bActiveCategory = false)
    {
        $obCategoryItem = CategoryItem::make($iCategoryID);
        if ($obCategoryItem->isEmpty()) {
            return;
        }

        $this->arResult[] = [
            'id'     => $obCategoryItem->id,
            'name'   => $obCategoryItem->name,
            'slug'   => $obCategoryItem->slug,
            'active' => $bActiveCategory,
            'item'   => $obCategoryItem,
        ];

        if (!empty($obCategoryItem->parent_id)) {
            $this->addCategoryData($obCategoryItem->parent_id);
        }
    }
protected function addCategoryData($iCategoryID, $bActiveCategory = false)
    {
        $obCategoryItem = CategoryItem::make($iCategoryID);
        if ($obCategoryItem->isEmpty()) {
            return;
        }

        $this->arResult[] = [
            'id'     => $obCategoryItem->id,
            'name'   => $obCategoryItem->name,
            'slug'   => $obCategoryItem->slug,
            'active' => $bActiveCategory,
            'item'   => $obCategoryItem,
        ];

        if (!empty($obCategoryItem->parent_id)) {
            $this->addCategoryData($obCategoryItem->parent_id);
        }
    }
protected function addCategoryData ( $ iCategoryID , $ bActiveCategory = false ) { $ obCategoryItem = CategoryItem :: make ( $ iCategoryID ) ; if ( $ obCategoryItem -> isEmpty ( ) ) { return ; } $ this -> arResult [ ] = [ 'id' => $ obCategoryItem -> id , 'name' => $ obCategoryItem -> name , 'slug' => $ obCategoryItem -> slug , 'active' => $ bActiveCategory , 'item' => $ obCategoryItem , ] ; if ( ! empty ( $ obCategoryItem -> parent_id ) ) { $ this -> addCategoryData ( $ obCategoryItem -> parent_id ) ; } }
Add category data
@param int  $iCategoryID
@param bool $bActiveCategory
Add category data