83e6bda4896b007d54cfa4402b9bade9c3668ad3
[yaffs-website] / web / core / modules / workflows / src / TransitionInterface.php
1 <?php
2
3 namespace Drupal\workflows;
4
5 /**
6  * A transition value object that describes the transition between two states.
7  *
8  * @internal
9  *   The TransitionInterface should only be used by Workflows and Content
10  *   Moderation.
11  *
12  * @todo Revisit the need for this in https://www.drupal.org/node/2902309.
13  */
14 interface TransitionInterface {
15
16   /**
17    * The key of the transition plugin form.
18    */
19   const PLUGIN_FORM_KEY = 'transition';
20
21   /**
22    * The transition direction from.
23    */
24   const DIRECTION_FROM = 'from';
25
26   /**
27    * The transition direction to.
28    */
29   const DIRECTION_TO = 'to';
30
31   /**
32    * Gets the transition's ID.
33    *
34    * @return string
35    *   The transition's ID.
36    */
37   public function id();
38
39   /**
40    * Gets the transition's label.
41    *
42    * @return string
43    *   The transition's label.
44    */
45   public function label();
46
47   /**
48    * Gets the transition's from states.
49    *
50    * @return \Drupal\workflows\StateInterface[]
51    *   The transition's from states.
52    */
53   public function from();
54
55   /**
56    * Gets the transition's to state.
57    *
58    * @return \Drupal\workflows\StateInterface
59    *   The transition's to state.
60    */
61   public function to();
62
63   /**
64    * Gets the transition's weight.
65    *
66    * @return string
67    *   The transition's weight.
68    */
69   public function weight();
70
71 }