src/ShopBundle/objects/db/TShopArticle.class.php
public function IsInCategory($aCategoryList)
    {
        $bIsInCategory = false;
        if (in_array($this->fieldShopCategoryId, $aCategoryList)) {
            $bIsInCategory = true;
        } else {
            $aArticleCategories = $this->GetMLTIdList('shop_category_mlt');
            $aIntersec = array_intersect($aArticleCategories, $aCategoryList);
            if (0 == count($aIntersec) && 0 == count($aArticleCategories) && $this->IsVariant()) {
                $oParent = &$this->GetFieldVariantParent();
                if ($oParent) {
                    $bIsInCategory = $oParent->IsInCategory($aCategoryList);
                }
            } else {
                $bIsInCategory = (count($aIntersec) > 0);
            }
        }

        return $bIsInCategory;
    }
public function IsInCategory($aCategoryList)
    {
        $bIsInCategory = false;
        if (in_array($this->fieldShopCategoryId, $aCategoryList)) {
            $bIsInCategory = true;
        } else {
            $aArticleCategories = $this->GetMLTIdList('shop_category_mlt');
            $aIntersec = array_intersect($aArticleCategories, $aCategoryList);
            if (0 == count($aIntersec) && 0 == count($aArticleCategories) && $this->IsVariant()) {
                $oParent = &$this->GetFieldVariantParent();
                if ($oParent) {
                    $bIsInCategory = $oParent->IsInCategory($aCategoryList);
                }
            } else {
                $bIsInCategory = (count($aIntersec) > 0);
            }
        }

        return $bIsInCategory;
    }
public function IsInCategory ( $ aCategoryList ) { $ bIsInCategory = false ; if ( in_array ( $ this -> fieldShopCategoryId , $ aCategoryList ) ) { $ bIsInCategory = true ; } else { $ aArticleCategories = $ this -> GetMLTIdList ( 'shop_category_mlt' ) ; $ aIntersec = array_intersect ( $ aArticleCategories , $ aCategoryList ) ; if ( 0 == count ( $ aIntersec ) && 0 == count ( $ aArticleCategories ) && $ this -> IsVariant ( ) ) { $ oParent = & $ this -> GetFieldVariantParent ( ) ; if ( $ oParent ) { $ bIsInCategory = $ oParent -> IsInCategory ( $ aCategoryList ) ; } } else { $ bIsInCategory = ( count ( $ aIntersec ) > 0 ) ; } } return $ bIsInCategory ; }
return true if the article is in at least one of the categories.

@param array $aCategoryList

@return bool
return true if the article is in at least one of the categories .