src/Sulu/Bundle/PageBundle/Serializer/Subscriber/WorkflowStageSubscriber.php
public function onPostSerialize(ObjectEvent $event)
    {
        /** @var RedirectTypeBehavior $document */
        $document = $event->getObject();

        if (!$document instanceof WorkflowStageBehavior) {
            return;
        }

        $visitor = $event->getVisitor();
        $visitor->addData('publishedState', WorkflowStage::PUBLISHED === $document->getWorkflowStage());
    }
public function onPostSerialize(ObjectEvent $event)
    {
        /** @var RedirectTypeBehavior $document */
        $document = $event->getObject();

        if (!$document instanceof WorkflowStageBehavior) {
            return;
        }

        $visitor = $event->getVisitor();
        $visitor->addData('publishedState', WorkflowStage::PUBLISHED === $document->getWorkflowStage());
    }
public function onPostSerialize ( ObjectEvent $ event ) { /** @var RedirectTypeBehavior $document */ $ document = $ event -> getObject ( ) ; if ( ! $ document instanceof WorkflowStageBehavior ) { return ; } $ visitor = $ event -> getVisitor ( ) ; $ visitor -> addData ( 'publishedState' , WorkflowStage :: PUBLISHED === $ document -> getWorkflowStage ( ) ) ; }
Adds the published state to the serialization.

@param ObjectEvent $event
Adds the published state to the serialization .