src/Sulu/Bundle/PageBundle/Serializer/Subscriber/PathSubscriber.php
public function onPostSerialize(ObjectEvent $event)
    {
        $visitor = $event->getVisitor();
        $document = $event->getObject();

        if (!$document instanceof PathBehavior || !$this->documentRegistry->hasDocument($document)) {
            return;
        }

        $visitor->addData('path', $this->documentInspector->getContentPath($document));
    }
public function onPostSerialize(ObjectEvent $event)
    {
        $visitor = $event->getVisitor();
        $document = $event->getObject();

        if (!$document instanceof PathBehavior || !$this->documentRegistry->hasDocument($document)) {
            return;
        }

        $visitor->addData('path', $this->documentInspector->getContentPath($document));
    }
public function onPostSerialize ( ObjectEvent $ event ) { $ visitor = $ event -> getVisitor ( ) ; $ document = $ event -> getObject ( ) ; if ( ! $ document instanceof PathBehavior || ! $ this -> documentRegistry -> hasDocument ( $ document ) ) { return ; } $ visitor -> addData ( 'path' , $ this -> documentInspector -> getContentPath ( $ document ) ) ; }
Adds the relative path to the serialization.

@param ObjectEvent $event
Adds the relative path to the serialization .