source/Application/Model/CategoryList.php
protected function _addDepthInfo($aTree, $oCat, $sDepth = "")
    {
        $sDepth .= "-";
        $oCat->oxcategories__oxtitle->setValue($sDepth . ' ' . $oCat->oxcategories__oxtitle->value);
        $aTree[$oCat->getId()] = $oCat;
        $aSubCats = $oCat->getSubCats();
        if (count($aSubCats) > 0) {
            foreach ($aSubCats as $oSubCat) {
                $aTree = $this->_addDepthInfo($aTree, $oSubCat, $sDepth);
            }
        }

        return $aTree;
    }
protected function _addDepthInfo($aTree, $oCat, $sDepth = "")
    {
        $sDepth .= "-";
        $oCat->oxcategories__oxtitle->setValue($sDepth . ' ' . $oCat->oxcategories__oxtitle->value);
        $aTree[$oCat->getId()] = $oCat;
        $aSubCats = $oCat->getSubCats();
        if (count($aSubCats) > 0) {
            foreach ($aSubCats as $oSubCat) {
                $aTree = $this->_addDepthInfo($aTree, $oSubCat, $sDepth);
            }
        }

        return $aTree;
    }
protected function _addDepthInfo ( $ aTree , $ oCat , $ sDepth = "" ) { $ sDepth .= "-" ; $ oCat -> oxcategories__oxtitle -> setValue ( $ sDepth . ' ' . $ oCat -> oxcategories__oxtitle -> value ) ; $ aTree [ $ oCat -> getId ( ) ] = $ oCat ; $ aSubCats = $ oCat -> getSubCats ( ) ; if ( count ( $ aSubCats ) > 0 ) { foreach ( $ aSubCats as $ oSubCat ) { $ aTree = $ this -> _addDepthInfo ( $ aTree , $ oSubCat , $ sDepth ) ; } } return $ aTree ; }
Recursive function to add depth information

@param array  $aTree  new category tree
@param object $oCat   category object
@param string $sDepth string to show category depth

@return array $aTree
Recursive function to add depth information