source/Application/Model/Category.php
public function setSubCat($oCat, $sKey = null)
    {
        if ($sKey) {
            $this->_aSubCats[$sKey] = $oCat;
        } else {
            $this->_aSubCats[] = $oCat;
        }

        // keeping ref. to parent
        $oCat->setParentCategory($this);

        if ($oCat->getIsVisible()) {
            $this->setHasVisibleSubCats(true);
        }
    }
public function setSubCat($oCat, $sKey = null)
    {
        if ($sKey) {
            $this->_aSubCats[$sKey] = $oCat;
        } else {
            $this->_aSubCats[] = $oCat;
        }

        // keeping ref. to parent
        $oCat->setParentCategory($this);

        if ($oCat->getIsVisible()) {
            $this->setHasVisibleSubCats(true);
        }
    }
public function setSubCat ( $ oCat , $ sKey = null ) { if ( $ sKey ) { $ this -> _aSubCats [ $ sKey ] = $ oCat ; } else { $ this -> _aSubCats [ ] = $ oCat ; } // keeping ref. to parent $ oCat -> setParentCategory ( $ this ) ; if ( $ oCat -> getIsVisible ( ) ) { $ this -> setHasVisibleSubCats ( true ) ; } }
sets a single category, handles sorting and parent hasVisibleSubCats

@param \OxidEsales\Eshop\Application\Model\Category $oCat the category
@param string                                       $sKey (optional, default=null)  the key for that category,
without a key, the category is just added to the array
sets a single category handles sorting and parent hasVisibleSubCats