public function category($arCategoryIDList, $bWithChildren = false)
    {
        if (!is_array($arCategoryIDList)) {
            $arCategoryIDList = [$arCategoryIDList];
        }

        $arResultIDList = [];
        foreach ($arCategoryIDList as $iCategoryID) {
            $arResultIDList = array_merge($arResultIDList, (array) ProductListStore::instance()->category->get($iCategoryID));
            if ($bWithChildren) {
                $arResultIDList = array_merge($arResultIDList, (array) $this->getIDListChildrenCategory($iCategoryID));
            }
        }

        return $this->intersect($arResultIDList);
    }
public function category($arCategoryIDList, $bWithChildren = false)
    {
        if (!is_array($arCategoryIDList)) {
            $arCategoryIDList = [$arCategoryIDList];
        }

        $arResultIDList = [];
        foreach ($arCategoryIDList as $iCategoryID) {
            $arResultIDList = array_merge($arResultIDList, (array) ProductListStore::instance()->category->get($iCategoryID));
            if ($bWithChildren) {
                $arResultIDList = array_merge($arResultIDList, (array) $this->getIDListChildrenCategory($iCategoryID));
            }
        }

        return $this->intersect($arResultIDList);
    }
public function category ( $ arCategoryIDList , $ bWithChildren = false ) { if ( ! is_array ( $ arCategoryIDList ) ) { $ arCategoryIDList = [ $ arCategoryIDList ] ; } $ arResultIDList = [ ] ; foreach ( $ arCategoryIDList as $ iCategoryID ) { $ arResultIDList = array_merge ( $ arResultIDList , ( array ) ProductListStore :: instance ( ) -> category -> get ( $ iCategoryID ) ) ; if ( $ bWithChildren ) { $ arResultIDList = array_merge ( $ arResultIDList , ( array ) $ this -> getIDListChildrenCategory ( $ iCategoryID ) ) ; } } return $ this -> intersect ( $ arResultIDList ) ; }
Filter product list by category ID
@param int|array $arCategoryIDList
@param bool $bWithChildren
@return $this
Filter product list by category ID