src/ShopBundle/objects/TShopCategoryTree/TShopCategoryTree.class.php
public function AddItemCount($sCategoryId, $iArticleCount)
    {
        $bSet = false;
        if (array_key_exists($sCategoryId, $this->aContainingChildCategories)) {
            $this->iAllItemCount = $this->iAllItemCount + $iArticleCount;
            if (!is_null($this->oChildCategoryTreeList)) {
                $this->oChildCategoryTreeList->GoToStart();
                while ($oChildCategoryTree = $this->oChildCategoryTreeList->Next()) {
                    if (!$bSet) {
                        $bSet = $oChildCategoryTree->AddItemCount($sCategoryId, $iArticleCount);
                    }
                }
            }
        } else {
            if (!is_null($this->oRealCategory) && $sCategoryId == $this->oRealCategory->id) {
                $this->iAllItemCount = $iArticleCount;
                $bSet = true;
            }
        }

        return $bSet;
    }
public function AddItemCount($sCategoryId, $iArticleCount)
    {
        $bSet = false;
        if (array_key_exists($sCategoryId, $this->aContainingChildCategories)) {
            $this->iAllItemCount = $this->iAllItemCount + $iArticleCount;
            if (!is_null($this->oChildCategoryTreeList)) {
                $this->oChildCategoryTreeList->GoToStart();
                while ($oChildCategoryTree = $this->oChildCategoryTreeList->Next()) {
                    if (!$bSet) {
                        $bSet = $oChildCategoryTree->AddItemCount($sCategoryId, $iArticleCount);
                    }
                }
            }
        } else {
            if (!is_null($this->oRealCategory) && $sCategoryId == $this->oRealCategory->id) {
                $this->iAllItemCount = $iArticleCount;
                $bSet = true;
            }
        }

        return $bSet;
    }
public function AddItemCount ( $ sCategoryId , $ iArticleCount ) { $ bSet = false ; if ( array_key_exists ( $ sCategoryId , $ this -> aContainingChildCategories ) ) { $ this -> iAllItemCount = $ this -> iAllItemCount + $ iArticleCount ; if ( ! is_null ( $ this -> oChildCategoryTreeList ) ) { $ this -> oChildCategoryTreeList -> GoToStart ( ) ; while ( $ oChildCategoryTree = $ this -> oChildCategoryTreeList -> Next ( ) ) { if ( ! $ bSet ) { $ bSet = $ oChildCategoryTree -> AddItemCount ( $ sCategoryId , $ iArticleCount ) ; } } } } else { if ( ! is_null ( $ this -> oRealCategory ) && $ sCategoryId == $ this -> oRealCategory -> id ) { $ this -> iAllItemCount = $ iArticleCount ; $ bSet = true ; } } return $ bSet ; }
Add item count to category in tree and add it to all parent categories.

@param  $sCategoryId
@param  $iArticleCount

@return bool
Add item count to category in tree and add it to all parent categories .