forked from symfony/workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWorkflowInterface.php
More file actions
76 lines (64 loc) · 1.83 KB
/
WorkflowInterface.php
File metadata and controls
76 lines (64 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow;
use Symfony\Component\Workflow\Exception\LogicException;
use Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface;
use Symfony\Component\Workflow\Metadata\MetadataStoreInterface;
/**
* @author Amrouche Hamza <hamza.simperfit@gmail.com>
*/
interface WorkflowInterface
{
/**
* Returns the object's Marking.
*
* @return Marking The Marking
*
* @throws LogicException
*/
public function getMarking(object $subject);
/**
* Returns true if the transition is enabled.
*
* @return bool true if the transition is enabled
*/
public function can(object $subject, string $transitionName);
/**
* Builds a TransitionBlockerList to know why a transition is blocked.
*/
public function buildTransitionBlockerList(object $subject, string $transitionName): TransitionBlockerList;
/**
* Fire a transition.
*
* @return Marking The new Marking
*
* @throws LogicException If the transition is not applicable
*/
public function apply(object $subject, string $transitionName, array $context = []);
/**
* Returns all enabled transitions.
*
* @return Transition[] All enabled transitions
*/
public function getEnabledTransitions(object $subject);
/**
* @return string
*/
public function getName();
/**
* @return Definition
*/
public function getDefinition();
/**
* @return MarkingStoreInterface
*/
public function getMarkingStore();
public function getMetadataStore(): MetadataStoreInterface;
}