1 | <?php |
||
14 | class Transition implements TransitionInterface, WeightedInterface |
||
15 | { |
||
16 | /** |
||
17 | * @var StateInterface |
||
18 | */ |
||
19 | private $targetState; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $eventName; |
||
25 | |||
26 | /** |
||
27 | * @var ConditionInterface |
||
28 | */ |
||
29 | private $condition; |
||
30 | |||
31 | /** |
||
32 | * @var float |
||
33 | */ |
||
34 | private $weight = 1; |
||
35 | |||
36 | /** |
||
37 | * @param StateInterface $targetState |
||
38 | * @param string $eventName |
||
39 | * @param ConditionInterface $condition |
||
40 | */ |
||
41 | 20 | public function __construct(StateInterface $targetState, $eventName = null, ConditionInterface $condition = null) |
|
47 | |||
48 | /** |
||
49 | * @see MetaborStd\Statemachine.TransitionInterface::getTargetState() |
||
50 | */ |
||
51 | 10 | public function getTargetState() |
|
55 | |||
56 | /** |
||
57 | * @see MetaborStd\Statemachine.TransitionInterface::getEventName() |
||
58 | */ |
||
59 | 18 | public function getEventName() |
|
63 | |||
64 | /** |
||
65 | * @see MetaborStd\Statemachine.TransitionInterface::getConditionName() |
||
66 | */ |
||
67 | 10 | public function getConditionName() |
|
73 | |||
74 | /** |
||
75 | * @see MetaborStd\Statemachine.TransitionInterface::isActive() |
||
76 | */ |
||
77 | 3 | public function isActive($subject, \ArrayAccess $context, EventInterface $event = null) |
|
90 | |||
91 | /** |
||
92 | * @return \MetaborStd\Statemachine\ConditionInterface |
||
93 | */ |
||
94 | 3 | public function getCondition() |
|
98 | |||
99 | /** |
||
100 | * @return float |
||
101 | */ |
||
102 | 2 | public function getWeight() |
|
106 | |||
107 | /** |
||
108 | * @param float $weight |
||
109 | */ |
||
110 | 2 | public function setWeight($weight) |
|
114 | } |
||
115 |