Document/Serializer/ArticleSubscriber.php
public function addBrokenIndicatorOnPostSerialize(ObjectEvent $event)
    {
        $article = $event->getObject();
        $visitor = $event->getVisitor();

        if (!($article instanceof ArticleViewDocumentInterface)) {
            return;
        }

        $structure = $this->structureManager->getStructure($article->getStructureType(), 'article');
        $visitor->addData('broken', !$structure || $structure->getKey() !== $article->getStructureType());
        $visitor->addData('originalStructureType', $article->getStructureType());
    }
public function addBrokenIndicatorOnPostSerialize(ObjectEvent $event)
    {
        $article = $event->getObject();
        $visitor = $event->getVisitor();

        if (!($article instanceof ArticleViewDocumentInterface)) {
            return;
        }

        $structure = $this->structureManager->getStructure($article->getStructureType(), 'article');
        $visitor->addData('broken', !$structure || $structure->getKey() !== $article->getStructureType());
        $visitor->addData('originalStructureType', $article->getStructureType());
    }
public function addBrokenIndicatorOnPostSerialize ( ObjectEvent $ event ) { $ article = $ event -> getObject ( ) ; $ visitor = $ event -> getVisitor ( ) ; if ( ! ( $ article instanceof ArticleViewDocumentInterface ) ) { return ; } $ structure = $ this -> structureManager -> getStructure ( $ article -> getStructureType ( ) , 'article' ) ; $ visitor -> addData ( 'broken' , ! $ structure || $ structure -> getKey ( ) !== $ article -> getStructureType ( ) ) ; $ visitor -> addData ( 'originalStructureType' , $ article -> getStructureType ( ) ) ; }
Append broken-indicator to result.

@param ObjectEvent $event
Append broken - indicator to result .