Bundle/SitemapBundle/Domain/Export/SitemapExportHandler.php
private function getBusinessPages(ViewReference $tree, $businessPages = [])
    {
        foreach ($tree->getChildren() as $child) {
            if ($child instanceof BusinessPageReference
                && $child->getViewNamespace() === VirtualBusinessPage::class
            ) {
                /** @var WebViewInterface $businessPage */
                $businessPage = $this->pageHelper->findPageByReference($child);
                if ($businessPage->isPublished()) {
                    $businessPage->setReference($child);
                    $businessPages[] = $businessPage;
                }
            }
            $businessPages = $this->getBusinessPages($child, $businessPages);
        }

        return $businessPages;
    }
private function getBusinessPages(ViewReference $tree, $businessPages = [])
    {
        foreach ($tree->getChildren() as $child) {
            if ($child instanceof BusinessPageReference
                && $child->getViewNamespace() === VirtualBusinessPage::class
            ) {
                /** @var WebViewInterface $businessPage */
                $businessPage = $this->pageHelper->findPageByReference($child);
                if ($businessPage->isPublished()) {
                    $businessPage->setReference($child);
                    $businessPages[] = $businessPage;
                }
            }
            $businessPages = $this->getBusinessPages($child, $businessPages);
        }

        return $businessPages;
    }
private function getBusinessPages ( ViewReference $ tree , $ businessPages = [ ] ) { foreach ( $ tree -> getChildren ( ) as $ child ) { if ( $ child instanceof BusinessPageReference && $ child -> getViewNamespace ( ) === VirtualBusinessPage :: class ) { /** @var WebViewInterface $businessPage */ $ businessPage = $ this -> pageHelper -> findPageByReference ( $ child ) ; if ( $ businessPage -> isPublished ( ) ) { $ businessPage -> setReference ( $ child ) ; $ businessPages [ ] = $ businessPage ; } } $ businessPages = $ this -> getBusinessPages ( $ child , $ businessPages ) ; } return $ businessPages ; }
Get all VirtualBusinessPage recursively.

@param ViewReference $tree
@param array         $businessPages

@throws \Exception

@return array
Get all VirtualBusinessPage recursively .