Skip to content

Commit

Permalink
added configuration for article-page object
Browse files Browse the repository at this point in the history
  • Loading branch information
wachterjohannes committed May 8, 2017
1 parent e862d96 commit e8452d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Sulu\Bundle\ArticleBundle\DependencyInjection;

use Sulu\Bundle\ArticleBundle\Document\ArticlePageViewObject;
use Sulu\Bundle\ArticleBundle\Document\ArticleViewDocument;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
Expand Down Expand Up @@ -58,6 +59,12 @@ public function getConfigTreeBuilder()
->scalarNode('view')->defaultValue(ArticleViewDocument::class)->end()
->end()
->end()
->arrayNode('article_page')
->addDefaultsIfNotSet()
->children()
->scalarNode('view')->defaultValue(ArticlePageViewObject::class)->end()
->end()
->end()
->end()
->end()
->arrayNode('types')
Expand Down
2 changes: 1 addition & 1 deletion Document/Index/ArticleIndexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ private function mapPages(ArticleDocument $document, ArticleViewDocumentInterfac
{
$pages = [];
foreach ($document->getChildren() as $child) {
$pages[] = $page = new ArticlePageViewObject();
$pages[] = $page = $this->documentFactory->create('article_page');
$page->uuid = $child->getUuid();
$page->pageNumber = $child->getPageNumber();
$page->title = $child->getPageTitle();
Expand Down

0 comments on commit e8452d3

Please sign in to comment.