Fork me on Github

Class Finite\StateMachine\ SecurityAwareStateMachine

Security Aware state machine.

Use the Symfony Security Component and ACL.

Need an ACL implementation available, Doctrine DBAL by default.


Inherits from: ListenableStateMachine

StatefulInterface $object The stateful object
array $states The available states
array $transitions The available transitions
StateInterface $currentState The current state

Methods

setEventDispatcher( EventDispatcherInterface $dispatcher)

from ListenableStateMachine
initialize()

Initialize the State Machine current state

from ListenableStateMachine
mixed apply( string $transitionName)

Apply a transition

from ListenableStateMachine
setSecurityContext( SecurityContextInterface $securityContext)

can($transition)

Details

public setEventDispatcher( EventDispatcherInterface $dispatcher)

Parameters
EventDispatcherInterface $dispatcher

public initialize()

Initialize the State Machine current state

public mixed apply( string $transitionName)

Apply a transition

Parameters
string $transitionName
Return Value
mixed

public setSecurityContext( SecurityContextInterface $securityContext)

Parameters
SecurityContextInterface $securityContext

public can($transition)

Parameters
$transition