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

        if (!$document instanceof ParentBehavior || !$document->getParent() instanceof UuidBehavior) {
            return;
        }

        $visitor->addData('parentUuid', $document->getParent()->getUuid());
    }
public function onPostSerialize(ObjectEvent $event)
    {
        $visitor = $event->getVisitor();
        $document = $event->getObject();

        if (!$document instanceof ParentBehavior || !$document->getParent() instanceof UuidBehavior) {
            return;
        }

        $visitor->addData('parentUuid', $document->getParent()->getUuid());
    }
public function onPostSerialize ( ObjectEvent $ event ) { $ visitor = $ event -> getVisitor ( ) ; $ document = $ event -> getObject ( ) ; if ( ! $ document instanceof ParentBehavior || ! $ document -> getParent ( ) instanceof UuidBehavior ) { return ; } $ visitor -> addData ( 'parentUuid' , $ document -> getParent ( ) -> getUuid ( ) ) ; }
Adds the identifier of the parent document to the serialization.

@param ObjectEvent $event
Adds the identifier of the parent document to the serialization .