Exemple #1
0
 /**
  * @covers BackBee\NestedNode\Page::setWorkflowState
  */
 public function testSetWorkflowState()
 {
     $state = new State();
     $this->assertEquals($this->page, $this->page->setWorkflowState($state));
     $this->assertEquals($state, $this->page->getWorkflowState());
     $this->assertEquals($this->page, $this->page->setWorkflowState(null));
     $this->assertNull($this->page->getWorkflowState());
 }
Exemple #2
0
 /**
  * Page workflow state setter.
  *
  * @param Page  $page
  * @param State $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);
         }
     }
 }