PHP Class Finite\StateMachine\StateMachine

Author: Yohan Giarelli ([email protected])
Inheritance: implements Finite\StateMachine\StateMachineInterface
Afficher le fichier Open project: yohang/finite Class Usage Examples

Protected Properties

Свойство Type Description
$currentState Finite\State\StateInterface The current state.
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$graph string
$object object The stateful object.
$stateAccessor Finite\State\Accessor\StateAccessorInterface
$states array The available states.
$transitions array The available transitions.

Méthodes publiques

Méthode Description
__construct ( object $object = null, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher = null, Finite\State\Accessor\StateAccessorInterface $stateAccessor = null )
addState ( $state )
addTransition ( $transition, $initialState = null, $finalState = null )
apply ( $transitionName, array $parameters = [] )
can ( $transition, array $parameters = [] )
findStateWithProperty ( $property, $value = null ) {@inheritDoc}
getCurrentState ( )
getDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface
getGraph ( )
getObject ( )
getState ( $name )
getStates ( )
getTransition ( $name )
getTransitions ( )
hasStateAccessor ( )
initialize ( )
setDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher )
setGraph ( $graph )
setObject ( $object )
setStateAccessor ( Finite\State\Accessor\StateAccessorInterface $stateAccessor )

Méthodes protégées

Méthode Description
findInitialState ( ) : string Find and return the Initial state if exists.

Private Methods

Méthode Description
dispatchTransitionEvent ( Finite\Transition\TransitionInterface $transition, Finite\Event\TransitionEvent $event, type $transitionState ) Dispatches event for the transition

Method Details

__construct() public méthode

public __construct ( object $object = null, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher = null, Finite\State\Accessor\StateAccessorInterface $stateAccessor = null )
$object object
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$stateAccessor Finite\State\Accessor\StateAccessorInterface

addState() public méthode

public addState ( $state )

addTransition() public méthode

public addTransition ( $transition, $initialState = null, $finalState = null )

apply() public méthode

public apply ( $transitionName, array $parameters = [] )
$parameters array

can() public méthode

public can ( $transition, array $parameters = [] )
$parameters array

findInitialState() protected méthode

Find and return the Initial state if exists.
protected findInitialState ( ) : string
Résultat string

findStateWithProperty() public méthode

{@inheritDoc}
public findStateWithProperty ( $property, $value = null )

getCurrentState() public méthode

public getCurrentState ( )

getDispatcher() public méthode

public getDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface
Résultat Symfony\Component\EventDispatcher\EventDispatcherInterface

getGraph() public méthode

public getGraph ( )

getObject() public méthode

public getObject ( )

getState() public méthode

public getState ( $name )

getStates() public méthode

public getStates ( )

getTransition() public méthode

public getTransition ( $name )

getTransitions() public méthode

public getTransitions ( )

hasStateAccessor() public méthode

public hasStateAccessor ( )

initialize() public méthode

public initialize ( )

setDispatcher() public méthode

public setDispatcher ( Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher )
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface

setGraph() public méthode

public setGraph ( $graph )

setObject() public méthode

public setObject ( $object )

setStateAccessor() public méthode

public setStateAccessor ( Finite\State\Accessor\StateAccessorInterface $stateAccessor )
$stateAccessor Finite\State\Accessor\StateAccessorInterface

Property Details

$currentState protected_oe property

The current state.
protected StateInterface,Finite\State $currentState
Résultat Finite\State\StateInterface

$dispatcher protected_oe property

protected EventDispatcherInterface,Symfony\Component\EventDispatcher $dispatcher
Résultat Symfony\Component\EventDispatcher\EventDispatcherInterface

$graph protected_oe property

protected string $graph
Résultat string

$object protected_oe property

The stateful object.
protected object $object
Résultat object

$stateAccessor protected_oe property

protected StateAccessorInterface,Finite\State\Accessor $stateAccessor
Résultat Finite\State\Accessor\StateAccessorInterface

$states protected_oe property

The available states.
protected array $states
Résultat array

$transitions protected_oe property

The available transitions.
protected array $transitions
Résultat array