public function groupLinksByDepth(){
        $final_items = [];
        $this->each(function(Link $linkObj, $uri) use(&$final_items){
            $final_items[$linkObj->getCrawlDepth()][$uri] = [
               'link'  => $linkObj->getAbsoluteUrl(),
               'source_page' => $linkObj->getParentUrl(),
            ];          
        });
        
        ksort($final_items);
        return $this->make($final_items);
    }
public function groupLinksByDepth(){
        $final_items = [];
        $this->each(function(Link $linkObj, $uri) use(&$final_items){
            $final_items[$linkObj->getCrawlDepth()][$uri] = [
               'link'  => $linkObj->getAbsoluteUrl(),
               'source_page' => $linkObj->getParentUrl(),
            ];          
        });
        
        ksort($final_items);
        return $this->make($final_items);
    }
public function groupLinksByDepth ( ) { $ final_items = [ ] ; $ this -> each ( function ( Link $ linkObj , $ uri ) use ( & $ final_items ) { $ final_items [ $ linkObj -> getCrawlDepth ( ) ] [ $ uri ] = [ 'link' => $ linkObj -> getAbsoluteUrl ( ) , 'source_page' => $ linkObj -> getParentUrl ( ) , ] ; } ) ; ksort ( $ final_items ) ; return $ this -> make ( $ final_items ) ; }
getting links grouped by depth of first traversing
@return LinksCollection
getting links grouped by depth of first traversing