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

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

        $structure = $this->structureManager->getStructure($article->getStructureType(), 'article');
        $visitor->addData('articleType', $context->accept($this->getType($structure->getStructure())));
    }
public function addTypeOnPostSerialize(ObjectEvent $event)
    {
        $article = $event->getObject();
        $visitor = $event->getVisitor();
        $context = $event->getContext();

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

        $structure = $this->structureManager->getStructure($article->getStructureType(), 'article');
        $visitor->addData('articleType', $context->accept($this->getType($structure->getStructure())));
    }
public function addTypeOnPostSerialize ( ObjectEvent $ event ) { $ article = $ event -> getObject ( ) ; $ visitor = $ event -> getVisitor ( ) ; $ context = $ event -> getContext ( ) ; if ( ! ( $ article instanceof ArticleDocument ) ) { return ; } $ structure = $ this -> structureManager -> getStructure ( $ article -> getStructureType ( ) , 'article' ) ; $ visitor -> addData ( 'articleType' , $ context -> accept ( $ this -> getType ( $ structure -> getStructure ( ) ) ) ) ; }
Append type to result.

@param ObjectEvent $event
Append type to result .