raoul2000\workflow\base\Workflow::getAllStatuses PHP Метод

getAllStatuses() публичный Метод

См. также: raoul2000\workflow\base\WorkflowInterface::getAllStatuses()
public getAllStatuses ( )
    public function getAllStatuses()
    {
        if ($this->getSource() === null) {
            throw new WorkflowException('no workflow source component available');
        }
        return $this->getSource()->getAllStatuses($this->getId());
    }

Usage Example

 public function testAccessorFails()
 {
     // creating a Workflow with 'new' will not allow to use some accessors
     $w = new Workflow(['id' => 'wid', 'initialStatusId' => 'A']);
     $this->specify('fails to get initial status if no source component is available', function () use($w) {
         $this->setExpectedException('raoul2000\\workflow\\base\\WorkflowException', 'no workflow source component available');
         $w->getInitialStatus();
     });
     $this->specify('fails to get all statues if no source component is available', function () use($w) {
         $this->setExpectedException('raoul2000\\workflow\\base\\WorkflowException', 'no workflow source component available');
         $w->getAllStatuses();
     });
 }