1 | <?php |
||
24 | class TransitionApplier |
||
25 | { |
||
26 | /** |
||
27 | * Subject manipulator |
||
28 | * |
||
29 | * @var SubjectManipulator |
||
30 | */ |
||
31 | private $subjectManipulator; |
||
32 | |||
33 | /** |
||
34 | * Logger |
||
35 | * |
||
36 | * @var LoggerInterface |
||
37 | */ |
||
38 | private $logger; |
||
39 | |||
40 | /** |
||
41 | * TransitionApplier constructor. |
||
42 | * |
||
43 | * @param SubjectManipulator $subjectManipulator subject manipulator |
||
44 | * @param LoggerInterface $logger logger |
||
45 | */ |
||
46 | public function __construct(SubjectManipulator $subjectManipulator, LoggerInterface $logger) |
||
51 | |||
52 | /** |
||
53 | * Applies single transition |
||
54 | * |
||
55 | * @param WorkflowContext $workflowContext workflow context |
||
56 | * @param string $transition transition to be applied |
||
57 | */ |
||
58 | public function applyTransition(WorkflowContext $workflowContext, $transition) |
||
62 | |||
63 | /** |
||
64 | * Applies list of transitions |
||
65 | * |
||
66 | * @param WorkflowContext $workflowContext workflow context |
||
67 | * @param array $transitions list of transitions to be applied |
||
68 | * @param bool $cascade if this flag is set all the available transitions should be applied (it |
||
69 | * may be cascade); otherwise the first applied transition breaks execution |
||
70 | */ |
||
71 | public function applyTransitions(WorkflowContext $workflowContext, array $transitions = [], $cascade = false) |
||
109 | } |