private function trySetPageWorkflowState(Page $page, State $workflow = null)
    {
        $page->setWorkflowState(null);
        if (null !== $workflow) {
            if (null === $workflow->getLayout() || $workflow->getLayout()->getUid() === $page->getLayout()->getUid()) {
                $page->setWorkflowState($workflow);
            }
        }
    }
private function trySetPageWorkflowState(Page $page, State $workflow = null)
    {
        $page->setWorkflowState(null);
        if (null !== $workflow) {
            if (null === $workflow->getLayout() || $workflow->getLayout()->getUid() === $page->getLayout()->getUid()) {
                $page->setWorkflowState($workflow);
            }
        }
    }
private function trySetPageWorkflowState ( Page $ page , State $ workflow = null ) { $ page -> setWorkflowState ( null ) ; if ( null !== $ workflow ) { if ( null === $ workflow -> getLayout ( ) || $ workflow -> getLayout ( ) -> getUid ( ) === $ page -> getLayout ( ) -> getUid ( ) ) { $ page -> setWorkflowState ( $ workflow ) ; } } }
Page workflow state setter.

@param Page  $page
@param State $workflow
Page workflow state setter .