add() public method

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 $identifier, string $state, string $message = null ) : boolean
$identifier izzum\statemachine\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.
 public function add(Identifier $identifier, $state, $message = null)
 {
     return $this->writer->add($identifier, $state, $message);
 }