It adds a record to the underlying implementation about when the stateful
object was first generated/manipulated.
This method can safely be called multiple times. It will only add data
when there is no state information already present.
This template method creates a record in the underlying persistence layer where
it's initial state is set.
It can then be manipulated via other methods via this Adapter or via
the statemachine itself eg: via 'getEntityIds' etc.
public add ( |
||
$identifier | ||
$state | string | the initial state to set, which should be known to the client of the statemachine the first time a machine is created. this can also be retrieved via a loaded statemachine: $machine->getInitialState()->getName() |
$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 | boolean | true if it was added, false if it was already there. |