PHP Class izzum\statemachine\utils\ReaderWriterDelegator

This allows us to load the statemachine configuration from a specific source and use a different sink to write the current state and history information to. You might want to do this to read the relatively static content for the configuration from the filesystem and use a fast backend system to write the state and transition history data to. for example: - use an xml file with the PDO (sql) adapter: izzum\statemachine\loader\XML & izzum\statemachine\persistence\PDO - use a json file with the Redis adapter: izzum\statemachine\loader\JSON & izzum\statemachine\persistence\Redis classes - use php code to configure the machine with the Session adapter: izzum\statemachine\loader\LoaderArray & izzum\statemachine\persistence\Session classes)
Author: Rolf Vreijdenberger
Inheritance: extends izzum\statemachine\persistence\Adapter, implements izzum\statemachine\loader\Loader
Show file Open project: rolfvreijdenberger/izzum-statemachine Class Usage Examples

Public Methods

Method Description
__construct ( izzum\statemachine\loader\Loader $reader, Adapter $writer )
__toString ( )
add ( Identifier $identifier, $state, $message = null )
getEntityIds ( $machine, $state = null )
getReader ( ) : izzum\statemachine\loader\Loader gets the reader/Loader
getWriter ( ) : Adapter gets the writer/Adapter
isPersisted ( Identifier $identifier )
load ( StateMachine $stateMachine )
processGetState ( Identifier $identifier )
processSetState ( Identifier $identifier, $state, $message = null )
setFailedTransition ( Identifier $identifier, Transition $transition, Exception $e )
toString ( )

Method Details

__construct() public method

public __construct ( izzum\statemachine\loader\Loader $reader, Adapter $writer )
$reader izzum\statemachine\loader\Loader the Loader instance to decorate
$writer izzum\statemachine\persistence\Adapter the Adapter instance to decorate

__toString() public method

public __toString ( )

add() public method

public add ( Identifier $identifier, $state, $message = null )
$identifier izzum\statemachine\Identifier

getEntityIds() public method

public getEntityIds ( $machine, $state = null )

getReader() public method

gets the reader/Loader
public getReader ( ) : izzum\statemachine\loader\Loader
return izzum\statemachine\loader\Loader

getWriter() public method

gets the writer/Adapter
public getWriter ( ) : Adapter
return izzum\statemachine\persistence\Adapter

isPersisted() public method

public isPersisted ( Identifier $identifier )
$identifier izzum\statemachine\Identifier

load() public method

public load ( StateMachine $stateMachine )
$stateMachine izzum\statemachine\StateMachine

processGetState() public method

public processGetState ( Identifier $identifier )
$identifier izzum\statemachine\Identifier

processSetState() public method

public processSetState ( Identifier $identifier, $state, $message = null )
$identifier izzum\statemachine\Identifier

setFailedTransition() public method

public setFailedTransition ( Identifier $identifier, Transition $transition, Exception $e )
$identifier izzum\statemachine\Identifier
$transition izzum\statemachine\Transition
$e Exception

toString() public method

public toString ( )