PHP Класс Finite\StateMachine\StateMachine

Автор: Yohan Giarelli ([email protected])
Наследование: implements Finite\StateMachine\StateMachineInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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.

Открытые методы

Метод Описание
__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 )

Защищенные методы

Метод Описание
findInitialState ( ) : string Find and return the Initial state if exists.

Приватные методы

Метод Описание
dispatchTransitionEvent ( Finite\Transition\TransitionInterface $transition, Finite\Event\TransitionEvent $event, type $transitionState ) Dispatches event for the transition

Описание методов

__construct() публичный метод

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 addState ( $state )

addTransition() публичный метод

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

apply() публичный метод

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

can() публичный метод

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

findInitialState() защищенный метод

Find and return the Initial state if exists.
protected findInitialState ( ) : string
Результат string

findStateWithProperty() публичный метод

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

getCurrentState() публичный метод

public getCurrentState ( )

getDispatcher() публичный метод

public getDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface
Результат Symfony\Component\EventDispatcher\EventDispatcherInterface

getGraph() публичный метод

public getGraph ( )

getObject() публичный метод

public getObject ( )

getState() публичный метод

public getState ( $name )

getStates() публичный метод

public getStates ( )

getTransition() публичный метод

public getTransition ( $name )

getTransitions() публичный метод

public getTransitions ( )

hasStateAccessor() публичный метод

public hasStateAccessor ( )

initialize() публичный метод

public initialize ( )

setDispatcher() публичный метод

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

setGraph() публичный метод

public setGraph ( $graph )

setObject() публичный метод

public setObject ( $object )

setStateAccessor() публичный метод

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

Описание свойств

$currentState защищенное свойство

The current state.
protected StateInterface,Finite\State $currentState
Результат Finite\State\StateInterface

$dispatcher защищенное свойство

protected EventDispatcherInterface,Symfony\Component\EventDispatcher $dispatcher
Результат Symfony\Component\EventDispatcher\EventDispatcherInterface

$graph защищенное свойство

protected string $graph
Результат string

$object защищенное свойство

The stateful object.
protected object $object
Результат object

$stateAccessor защищенное свойство

protected StateAccessorInterface,Finite\State\Accessor $stateAccessor
Результат Finite\State\Accessor\StateAccessorInterface

$states защищенное свойство

The available states.
protected array $states
Результат array

$transitions защищенное свойство

The available transitions.
protected array $transitions
Результат array