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

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

        $property = $this->getPageTitleProperty($article);
        if ($property) {
            $visitor->addData('_pageTitlePropertyName', $context->accept($property->getName()));
        }
    }
public function addPageTitlePropertyNameOnPostSerialize(ObjectEvent $event)
    {
        $article = $event->getObject();
        $visitor = $event->getVisitor();
        $context = $event->getContext();

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

        $property = $this->getPageTitleProperty($article);
        if ($property) {
            $visitor->addData('_pageTitlePropertyName', $context->accept($property->getName()));
        }
    }
public function addPageTitlePropertyNameOnPostSerialize ( ObjectEvent $ event ) { $ article = $ event -> getObject ( ) ; $ visitor = $ event -> getVisitor ( ) ; $ context = $ event -> getContext ( ) ; if ( ! $ article instanceof ArticleInterface ) { return ; } $ property = $ this -> getPageTitleProperty ( $ article ) ; if ( $ property ) { $ visitor -> addData ( '_pageTitlePropertyName' , $ context -> accept ( $ property -> getName ( ) ) ) ; } }
Append page-title-property to result.

@param ObjectEvent $event
Append page - title - property to result .