public setState ( |
||
$identifier | (old state can be retrieved via the identifier and this class) | |
$state | string | this is the new state |
$message | string | optional message. this can be used by the persistence adapter to be part of the transition history to provide extra information about the transition. |
return | boolan | false if already stored before, true if just added |
public function setState(Identifier $identifier, $state, $message = null)
{
try {
// a subclass could map a state to
// something else that is used internally in legacy
// systems (eg: order.order_status)
return $this->processSetState($identifier, $state, $message);
} catch (\Exception $e) {
// a possible lowlevel nonstatemachine exception, wrap it and throw
$e = Utils::wrapToStateMachineException($e, Exception::IO_FAILURE_SET);
throw $e;
}
}