/** * sets a single category, handles sorting and parent hasVisibleSubCats * * @param oxcategory $oCat the category * @param string $sKey (optional, default=null) the key for that category, without a key, the category isjust added to the array * @param boolean $blSkipSorting (optional, default=false) should we skip sorting now? (deprecated on 2011.01.27 for v4.5.0) * * @return null */ public function setSubCat($oCat, $sKey = null, $blSkipSorting = false) { if ($sKey) { $this->_aSubCats[$sKey] = $oCat; } else { $this->_aSubCats[] = $oCat; } // keeping ref. to parent $oCat->setParentCategory($this); if ($oCat->getIsVisible()) { $this->setHasVisibleSubCats(true); } }