Classes/Dao/PageSeoDao.php
protected function listCalcDepth($pageUid, array $rootLineRaw, $depth = null)
    {
        if ($depth === null) {
            $depth = 1;
        }

        if (empty($rootLineRaw[$pageUid])) {
            // found root page
            return $depth;
        }

        // we must be at least in the first depth
        ++$depth;

        $pagePid = $rootLineRaw[$pageUid];

        if (!empty($pagePid)) {
            // recursive
            $depth = $this->listCalcDepth($pagePid, $rootLineRaw, $depth);
        }

        return $depth;
    }
protected function listCalcDepth($pageUid, array $rootLineRaw, $depth = null)
    {
        if ($depth === null) {
            $depth = 1;
        }

        if (empty($rootLineRaw[$pageUid])) {
            // found root page
            return $depth;
        }

        // we must be at least in the first depth
        ++$depth;

        $pagePid = $rootLineRaw[$pageUid];

        if (!empty($pagePid)) {
            // recursive
            $depth = $this->listCalcDepth($pagePid, $rootLineRaw, $depth);
        }

        return $depth;
    }
protected function listCalcDepth ( $ pageUid , array $ rootLineRaw , $ depth = null ) { if ( $ depth === null ) { $ depth = 1 ; } if ( empty ( $ rootLineRaw [ $ pageUid ] ) ) { // found root page return $ depth ; } // we must be at least in the first depth ++ $ depth ; $ pagePid = $ rootLineRaw [ $ pageUid ] ; if ( ! empty ( $ pagePid ) ) { // recursive $ depth = $ this -> listCalcDepth ( $ pagePid , $ rootLineRaw , $ depth ) ; } return $ depth ; }
Calculate the depth of a page

@param  integer $pageUid     Page UID
@param  array   $rootLineRaw Root line (raw list)
@param  integer $depth       Current depth

@return integer
Calculate the depth of a page