PHP Класс izzum\statemachine\loader\LoaderArray

The LoaderArray should always be the object that is used by other Loader implementations. This means other LoaderInterface implementations should delegate the loading to this class. You could implement the Loader interface and use object composition for the LoaderArray. A transition will be unique per StateMachine and is uniquely defined by the tuple of a starting state name and a destination state name. The data of the rule, command or the identity (===) of the states does not matter when a Transition is added to a StateMachine. The machine will react on a first come first serve basis. In short, just make sure your configuration data is ok. TRICKY: if multiple transitions share the same State object (for example as their origin/from state or their destination/to state) then at least make sure that those states share the exact same data. Ideally, they should point to the same State instance. Otherwise, transitions and states are actually stored on the statemachine on a first wins basis (the later transition/state instance is not stored). Transitions will be sorted before they are added to the machine based on if they contain a regex or not. All regex transitions will be added to the machine after the non-regex transitions have been added.
См. также: Transitions
См. также: State
См. также: PDO
Автор: Rolf Vreijdenberger
Наследование: implements izzum\statemachine\loader\Loader
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$transitions izzum\statemachine\Transition[]

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

Метод Описание
__construct ( Transition[] $transitions = [] )
__toString ( )
add ( Transition $transition ) add/overwrite a transition
count ( ) : integer counts the number of contained transitions.
getTransitions ( ) : Transition[] This method will return the transitions instances with the correct references to each other.
load ( StateMachine $stateMachine ) {@inheritDoc}
toString ( )

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

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

public __construct ( Transition[] $transitions = [] )
$transitions izzum\statemachine\Transition[] the transitions to be loaded

__toString() публичный Метод

public __toString ( )

add() публичный Метод

add/overwrite a transition
public add ( Transition $transition )
$transition izzum\statemachine\Transition

count() публичный Метод

this is not the same as the possible amount of transitions added (because of regex transitions)
public count ( ) : integer
Результат integer

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

This method will return the transitions instances with the correct references to each other.
public getTransitions ( ) : Transition[]
Результат izzum\statemachine\Transition[]

load() публичный Метод

{@inheritDoc}
public load ( StateMachine $stateMachine )
$stateMachine izzum\statemachine\StateMachine

toString() публичный Метод

public toString ( )

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

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

protected Transition[],izzum\statemachine $transitions
Результат izzum\statemachine\Transition[]