PHP Class SM\Factory\AbstractFactory

Inheritance: implements SM\Factory\ClearableFactoryInterface
Exibir arquivo Open project: winzou/state-machine Class Usage Examples

Protected Properties

Property Type Description
$configs array
$stateMachines array

Public Methods

Method Description
__construct ( array $configs )
addConfig ( array $config, string $graph = 'default' ) Adds a new config
clear ( ) {@inheritDoc}
get ( $object, $graph = 'default' ) {@inheritDoc}

Protected Methods

Method Description
createStateMachine ( $object, array $config ) : SM\StateMachine\StateMachineInterface Create a state machine for the given object and config

Method Details

__construct() public method

public __construct ( array $configs )
$configs array Array of configs for the available state machines

addConfig() public method

Adds a new config
public addConfig ( array $config, string $graph = 'default' )
$config array
$graph string

clear() public method

{@inheritDoc}
public clear ( )

createStateMachine() abstract protected method

Create a state machine for the given object and config
abstract protected createStateMachine ( $object, array $config ) : SM\StateMachine\StateMachineInterface
$object
$config array
return SM\StateMachine\StateMachineInterface

get() public method

{@inheritDoc}
public get ( $object, $graph = 'default' )

Property Details

$configs protected_oe property

protected array $configs
return array

$stateMachines protected_oe property

protected array $stateMachines
return array