/** * @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; }
/** * @param StateObjectInterface $stateObject * @param StateInterface $targetState */ public function processTransaction(StateObjectInterface $stateObject, StateInterface $targetState) { $stateObject->setState($targetState); }