class StateMachine extends Workflow

Methods

__construct(Definition $definition, MarkingStoreInterface $markingStore = null, EventDispatcherInterface $dispatcher = null, $name = 'unnamed')

No description

getMarking(object $subject)

Returns the object's Marking.

from Workflow
bool
can(object $subject, string $transitionName)

Returns true if the transition is enabled.

from Workflow
apply(object $subject, string $transitionName)

Fire a transition.

from Workflow
getEnabledTransitions(object $subject)

Returns all enabled transitions.

from Workflow
getName()

No description

from Workflow
getDefinition()

No description

from Workflow

Details

at line line 14
__construct(Definition $definition, MarkingStoreInterface $markingStore = null, EventDispatcherInterface $dispatcher = null, $name = 'unnamed')

Parameters

Definition $definition
MarkingStoreInterface $markingStore
EventDispatcherInterface $dispatcher
$name

in Workflow at line line 50
Marking getMarking(object $subject)

Returns the object's Marking.

Parameters

object $subject A subject

Return Value

Marking The Marking

Exceptions

LogicException

in Workflow at line line 95
bool can(object $subject, string $transitionName)

Returns true if the transition is enabled.

Parameters

object $subject A subject
string $transitionName A transition

Return Value

bool true if the transition is enabled

Exceptions

LogicException If the transition does not exist

in Workflow at line line 114
Marking apply(object $subject, string $transitionName)

Fire a transition.

Parameters

object $subject A subject
string $transitionName A transition

Return Value

Marking The new Marking

Exceptions

LogicException If the transition is not applicable
LogicException If the transition does not exist

in Workflow at line line 143
Transition[] getEnabledTransitions(object $subject)

Returns all enabled transitions.

Parameters

object $subject A subject

Return Value

Transition[] All enabled transitions

in Workflow at line line 157
getName()

in Workflow at line line 165
Definition getDefinition()

Return Value

Definition