コード例 #1
0
 public function onSetInitialState(StateMachineEvent $event)
 {
     $object = $event->getStateMachine()->getObject();
     $result = $this->callCallback($object, 'can', 'initialize');
     if ($result === false) {
         throw new \Finite\Exception\StateException('State initialization has been rejected.');
     }
     $this->callCallback($object, 'post', 'initialize');
 }
コード例 #2
0
ファイル: TransitionEvent.php プロジェクト: actank/Finite
 /**
  * @param StateInterface      $initialState
  * @param TransitionInterface $transition
  * @param StateMachine        $stateMachine
  * @param array               $properties
  */
 public function __construct(StateInterface $initialState, TransitionInterface $transition, StateMachine $stateMachine, array $properties = array())
 {
     $this->transition = $transition;
     $this->initialState = $initialState;
     $this->properties = $properties;
     if ($transition instanceof PropertiesAwareTransitionInterface) {
         $this->properties = $transition->resolveProperties($properties);
     }
     parent::__construct($stateMachine);
 }
コード例 #3
0
ファイル: TransitionEvent.php プロジェクト: karmelak/Finite
 /**
  * @param StateInterface      $initialState
  * @param TransitionInterface $transition
  * @param StateMachine        $stateMachine
  */
 public function __construct(StateInterface $initialState, TransitionInterface $transition, StateMachine $stateMachine)
 {
     $this->transition = $transition;
     $this->initialState = $initialState;
     parent::__construct($stateMachine);
 }