src/ShopBundle/objects/TShopCategoryTree/TShopCategoryTree.class.php
public function MarkActiveCategories($aActiveCategories)
    {
        $this->bIsActive = false;
        if (in_array($this->id, $aActiveCategories)) {
            $this->bIsActive = true;
        } else {
            if (!is_null($this->oChildCategoryTreeList)) {
                $this->oChildCategoryTreeList->GoToStart();
                while (!$this->bIsActive && ($oCatTree = &$this->oChildCategoryTreeList->Next())) {
                    $this->bIsActive = $this->bIsActive || $oCatTree->MarkActiveCategories($aActiveCategories);
                }
                $this->oChildCategoryTreeList->GoToStart();
            }
        }

        return $this->bIsActive;
    }
public function MarkActiveCategories($aActiveCategories)
    {
        $this->bIsActive = false;
        if (in_array($this->id, $aActiveCategories)) {
            $this->bIsActive = true;
        } else {
            if (!is_null($this->oChildCategoryTreeList)) {
                $this->oChildCategoryTreeList->GoToStart();
                while (!$this->bIsActive && ($oCatTree = &$this->oChildCategoryTreeList->Next())) {
                    $this->bIsActive = $this->bIsActive || $oCatTree->MarkActiveCategories($aActiveCategories);
                }
                $this->oChildCategoryTreeList->GoToStart();
            }
        }

        return $this->bIsActive;
    }
public function MarkActiveCategories ( $ aActiveCategories ) { $ this -> bIsActive = false ; if ( in_array ( $ this -> id , $ aActiveCategories ) ) { $ this -> bIsActive = true ; } else { if ( ! is_null ( $ this -> oChildCategoryTreeList ) ) { $ this -> oChildCategoryTreeList -> GoToStart ( ) ; while ( ! $ this -> bIsActive && ( $ oCatTree = & $ this -> oChildCategoryTreeList -> Next ( ) ) ) { $ this -> bIsActive = $ this -> bIsActive || $ oCatTree -> MarkActiveCategories ( $ aActiveCategories ) ; } $ this -> oChildCategoryTreeList -> GoToStart ( ) ; } } return $ this -> bIsActive ; }
mark categories and their parents as active if they are in the array.

@param $aActiveCategories

@return bool
mark categories and their parents as active if they are in the array .