PHP Class SM\StateMachine\StateMachine

Inheritance: implements SM\StateMachine\StateMachineInterface
Afficher le fichier Open project: winzou/state-machine

Protected Properties

Свойство Type Description
$callbackFactory SM\Callback\CallbackFactoryInterface
$config array
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$object object

Méthodes publiques

Méthode Description
__construct ( object $object, array $config, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher = null, SM\Callback\CallbackFactoryInterface $callbackFactory = null )
apply ( $transition, $soft = false ) {@inheritDoc}
can ( $transition ) {@inheritDoc}
getGraph ( ) {@inheritDoc}
getObject ( ) {@inheritDoc}
getPossibleTransitions ( ) {@inheritDoc}
getState ( ) {@inheritDoc}

Méthodes protégées

Méthode Description
callCallbacks ( SM\Event\TransitionEvent $event, string $position ) : boolean Builds and calls the defined callbacks
setState ( string $state ) Set a new state to the underlying object

Method Details

__construct() public méthode

public __construct ( object $object, array $config, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher = null, SM\Callback\CallbackFactoryInterface $callbackFactory = null )
$object object Underlying object for the state machine
$config array Config array of the graph
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface EventDispatcher or null not to dispatch events
$callbackFactory SM\Callback\CallbackFactoryInterface CallbackFactory or null to use the default one

apply() public méthode

{@inheritDoc}
public apply ( $transition, $soft = false )

callCallbacks() protected méthode

Builds and calls the defined callbacks
protected callCallbacks ( SM\Event\TransitionEvent $event, string $position ) : boolean
$event SM\Event\TransitionEvent
$position string
Résultat boolean

can() public méthode

{@inheritDoc}
public can ( $transition )

getGraph() public méthode

{@inheritDoc}
public getGraph ( )

getObject() public méthode

{@inheritDoc}
public getObject ( )

getPossibleTransitions() public méthode

{@inheritDoc}

getState() public méthode

{@inheritDoc}
public getState ( )

setState() protected méthode

Set a new state to the underlying object
protected setState ( string $state )
$state string

Property Details

$callbackFactory protected_oe property

protected CallbackFactoryInterface,SM\Callback $callbackFactory
Résultat SM\Callback\CallbackFactoryInterface

$config protected_oe property

protected array $config
Résultat array

$dispatcher protected_oe property

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

$object protected_oe property

protected object $object
Résultat object