Document/Index/ArticleIndexer.php
private function mapPages(ArticleDocument $document, ArticleViewDocumentInterface $article)
    {
        $pages = [];
        /** @var ArticlePageDocument $child */
        foreach ($document->getChildren() as $child) {
            if (!$child instanceof ArticlePageDocument) {
                continue;
            }

            /** @var ArticlePageViewObject $page */
            $pages[] = $page = $this->documentFactory->create('article_page');
            $page->uuid = $child->getUuid();
            $page->pageNumber = $child->getPageNumber();
            $page->title = $child->getPageTitle();
            $page->routePath = $child->getRoutePath();
            $page->contentData = json_encode($child->getStructure()->toArray());
        }

        $article->setPages(new Collection($pages));
    }
private function mapPages(ArticleDocument $document, ArticleViewDocumentInterface $article)
    {
        $pages = [];
        /** @var ArticlePageDocument $child */
        foreach ($document->getChildren() as $child) {
            if (!$child instanceof ArticlePageDocument) {
                continue;
            }

            /** @var ArticlePageViewObject $page */
            $pages[] = $page = $this->documentFactory->create('article_page');
            $page->uuid = $child->getUuid();
            $page->pageNumber = $child->getPageNumber();
            $page->title = $child->getPageTitle();
            $page->routePath = $child->getRoutePath();
            $page->contentData = json_encode($child->getStructure()->toArray());
        }

        $article->setPages(new Collection($pages));
    }
private function mapPages ( ArticleDocument $ document , ArticleViewDocumentInterface $ article ) { $ pages = [ ] ; /** @var ArticlePageDocument $child */ foreach ( $ document -> getChildren ( ) as $ child ) { if ( ! $ child instanceof ArticlePageDocument ) { continue ; } /** @var ArticlePageViewObject $page */ $ pages [ ] = $ page = $ this -> documentFactory -> create ( 'article_page' ) ; $ page -> uuid = $ child -> getUuid ( ) ; $ page -> pageNumber = $ child -> getPageNumber ( ) ; $ page -> title = $ child -> getPageTitle ( ) ; $ page -> routePath = $ child -> getRoutePath ( ) ; $ page -> contentData = json_encode ( $ child -> getStructure ( ) -> toArray ( ) ) ; } $ article -> setPages ( new Collection ( $ pages ) ) ; }
Maps pages from document to view-document.

@param ArticleDocument $document
@param ArticleViewDocumentInterface $article
Maps pages from document to view - document .