src/Sulu/Component/Content/Document/Subscriber/WorkflowStageSubscriber.php
public function setWorkflowStageOnDocument(HydrateEvent $event)
    {
        $document = $event->getDocument();

        if (!$this->supports($event)) {
            return;
        }

        $node = $event->getNode();
        $locale = $event->getLocale();

        $document->setWorkflowStage(
            $node->getPropertyValueWithDefault(
                $this->propertyEncoder->localizedSystemName(self::WORKFLOW_STAGE_FIELD, $locale),
                WorkflowStage::TEST
            )
        );

        $event->getAccessor()->set(
            self::PUBLISHED_FIELD,
            $node->getPropertyValueWithDefault(
                $this->propertyEncoder->localizedSystemName(self::PUBLISHED_FIELD, $locale),
                null
            )
        );
    }
public function setWorkflowStageOnDocument(HydrateEvent $event)
    {
        $document = $event->getDocument();

        if (!$this->supports($event)) {
            return;
        }

        $node = $event->getNode();
        $locale = $event->getLocale();

        $document->setWorkflowStage(
            $node->getPropertyValueWithDefault(
                $this->propertyEncoder->localizedSystemName(self::WORKFLOW_STAGE_FIELD, $locale),
                WorkflowStage::TEST
            )
        );

        $event->getAccessor()->set(
            self::PUBLISHED_FIELD,
            $node->getPropertyValueWithDefault(
                $this->propertyEncoder->localizedSystemName(self::PUBLISHED_FIELD, $locale),
                null
            )
        );
    }
public function setWorkflowStageOnDocument ( HydrateEvent $ event ) { $ document = $ event -> getDocument ( ) ; if ( ! $ this -> supports ( $ event ) ) { return ; } $ node = $ event -> getNode ( ) ; $ locale = $ event -> getLocale ( ) ; $ document -> setWorkflowStage ( $ node -> getPropertyValueWithDefault ( $ this -> propertyEncoder -> localizedSystemName ( self :: WORKFLOW_STAGE_FIELD , $ locale ) , WorkflowStage :: TEST ) ) ; $ event -> getAccessor ( ) -> set ( self :: PUBLISHED_FIELD , $ node -> getPropertyValueWithDefault ( $ this -> propertyEncoder -> localizedSystemName ( self :: PUBLISHED_FIELD , $ locale ) , null ) ) ; }
Sets the workflow properties from the node on the document.

@param HydrateEvent $event

@throws \Sulu\Component\DocumentManager\Exception\DocumentManagerException
Sets the workflow properties from the node on the document .