コード例 #1
0
 /**
  * @param StateObjectInterface $model
  * @return StateInterface[]
  */
 public function getNextStates(StateObjectInterface $model)
 {
     $result = array();
     $modelStateId = $model->getState()->getId();
     if (isset($this->transitionStatesFlow[$modelStateId])) {
         foreach ($this->transitionStatesFlow[$modelStateId] as $transitionStateId) {
             $result[] = $this->states[$transitionStateId];
         }
     }
     return $result;
 }
コード例 #2
0
 /**
  * @param StateObjectInterface $stateObject
  * @param StateInterface $targetState
  */
 public function processTransaction(StateObjectInterface $stateObject, StateInterface $targetState)
 {
     $stateObject->setState($targetState);
 }