libSmalldb  v2.0.2
Public Member Functions | List of all members
TransitionDefinition Class Reference

Description

Definition of a state machine transition.

There may be multiple definitions of transitions with same names but different source states.

Inheritance diagram for TransitionDefinition

Public Member Functions

 __construct (string $name, StateDefinition $sourceState, array $targetStates, array $extensions=[])
 TransitionDefinition constructor. More...
 
 getName ()
 
 getSourceState ()
 Get source states of the transition. More...
 
 getTargetStates ()
 Get target states for the given source state. More...
 
 jsonSerialize ()
 
 hasExtension (string $extensionClassName)
 Return true if an extension of given type is defined for this element. More...
 
 getExtension (string $extensionClassName)
 Get an extension of given type. More...
 
 findExtension (string $extensionClassName)
 Get an extension of given type. More...
 
 getExtensionClassNames ()
 Get a list of existing extensions. More...
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( string  $name,
StateDefinition  $sourceState,
array  $targetStates,
array  $extensions = [] 
)

TransitionDefinition constructor.

Parameters
string$name
StateDefinition$sourceState
array$targetStates
ExtensionInterface[]$extensions

Member Function Documentation

◆ getName()

getName ( )

◆ getSourceState()

getSourceState ( )

Get source states of the transition.

◆ getTargetStates()

getTargetStates ( )

Get target states for the given source state.

Returns
StateDefinition[]

◆ jsonSerialize()

jsonSerialize ( )

◆ hasExtension()

hasExtension ( string  $extensionClassName)
inherited

Return true if an extension of given type is defined for this element.

◆ getExtension()

getExtension ( string  $extensionClassName)
inherited

Get an extension of given type.

Throws UndefinedExtensionException if the extension is not found.

It would be nice to write getExtension<T>(): T ...

ExtensionInterface

Parameters
class-string<ExtensionInterface>$extensionClassName
Returns
ExtensionInterface

◆ findExtension()

findExtension ( string  $extensionClassName)
inherited

Get an extension of given type.

Just like getExtension(), but returns null if the extension is not found.

It would be nice to write getExtension<T>(): T ...

ExtensionInterface

Parameters
class-string<ExtensionInterface>$extensionClassName
Returns
ExtensionInterface

◆ getExtensionClassNames()

getExtensionClassNames ( )
inherited

Get a list of existing extensions.

Returns
string[]