source/Application/Model/CategoryList.php
protected function _getDepthSqlSnippet($oCat)
    {
        $sViewName = $this->getBaseObject()->getViewName();
        $sDepthSnippet = ' ( 0';

        // load complete tree of active category, if it exists
        if ($oCat) {
            // select children here, siblings will be selected from union
            $sDepthSnippet .= " or ($sViewName.oxparentid = " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($oCat->oxcategories__oxid->value) . ")";
        }

        // load 1'st category level (roots)
        if ($this->getLoadLevel() >= 1) {
            $sDepthSnippet .= " or $sViewName.oxparentid = 'oxrootid'";
        }

        // load 2'nd category level ()
        if ($this->getLoadLevel() >= 2) {
            $sDepthSnippet .= " or $sViewName.oxrootid = $sViewName.oxparentid or $sViewName.oxid = $sViewName.oxrootid";
        }

        $sDepthSnippet .= ' ) ';

        return $sDepthSnippet;
    }
protected function _getDepthSqlSnippet($oCat)
    {
        $sViewName = $this->getBaseObject()->getViewName();
        $sDepthSnippet = ' ( 0';

        // load complete tree of active category, if it exists
        if ($oCat) {
            // select children here, siblings will be selected from union
            $sDepthSnippet .= " or ($sViewName.oxparentid = " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($oCat->oxcategories__oxid->value) . ")";
        }

        // load 1'st category level (roots)
        if ($this->getLoadLevel() >= 1) {
            $sDepthSnippet .= " or $sViewName.oxparentid = 'oxrootid'";
        }

        // load 2'nd category level ()
        if ($this->getLoadLevel() >= 2) {
            $sDepthSnippet .= " or $sViewName.oxrootid = $sViewName.oxparentid or $sViewName.oxid = $sViewName.oxrootid";
        }

        $sDepthSnippet .= ' ) ';

        return $sDepthSnippet;
    }
protected function _getDepthSqlSnippet ( $ oCat ) { $ sViewName = $ this -> getBaseObject ( ) -> getViewName ( ) ; $ sDepthSnippet = ' ( 0' ; // load complete tree of active category, if it exists if ( $ oCat ) { // select children here, siblings will be selected from union $ sDepthSnippet .= " or ($sViewName.oxparentid = " . \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) -> quote ( $ oCat -> oxcategories__oxid -> value ) . ")" ; } // load 1'st category level (roots) if ( $ this -> getLoadLevel ( ) >= 1 ) { $ sDepthSnippet .= " or $sViewName.oxparentid = 'oxrootid'" ; } // load 2'nd category level () if ( $ this -> getLoadLevel ( ) >= 2 ) { $ sDepthSnippet .= " or $sViewName.oxrootid = $sViewName.oxparentid or $sViewName.oxid = $sViewName.oxrootid" ; } $ sDepthSnippet .= ' ) ' ; return $ sDepthSnippet ; }
constructs the sql snippet responsible for depth optimizations,
loads only selected category's siblings

@param \OxidEsales\Eshop\Application\Model\Category $oCat selected category

@return string
constructs the sql snippet responsible for depth optimizations loads only selected category s siblings