public function filterByDepth($depth){
        return $this->filter(function(Link $link) use($depth){
            return $link->getCrawlDepth() == $depth;
        })->map(function(Link $link){
            return [
                'source_page' => $link->getParentUrl(),
                'link' => $link->getAbsoluteUrl(),
            ];
        });
    }
public function filterByDepth($depth){
        return $this->filter(function(Link $link) use($depth){
            return $link->getCrawlDepth() == $depth;
        })->map(function(Link $link){
            return [
                'source_page' => $link->getParentUrl(),
                'link' => $link->getAbsoluteUrl(),
            ];
        });
    }
public function filterByDepth ( $ depth ) { return $ this -> filter ( function ( Link $ link ) use ( $ depth ) { return $ link -> getCrawlDepth ( ) == $ depth ; } ) -> map ( function ( Link $ link ) { return [ 'source_page' => $ link -> getParentUrl ( ) , 'link' => $ link -> getAbsoluteUrl ( ) , ] ; } ) ; }
getting links in specific depth
@param int $depth
@return LinksCollection
getting links in specific depth