summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/workflows/src/TransitionInterface.php
blob: 83e6bda4896b007d54cfa4402b9bade9c3668ad3 (plain) (blame)
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
<?php

namespace Drupal\workflows;

/**
 * A transition value object that describes the transition between two states.
 *
 * @internal
 *   The TransitionInterface should only be used by Workflows and Content
 *   Moderation.
 *
 * @todo Revisit the need for this in https://www.drupal.org/node/2902309.
 */
interface TransitionInterface {

  /**
   * The key of the transition plugin form.
   */
  const PLUGIN_FORM_KEY = 'transition';

  /**
   * The transition direction from.
   */
  const DIRECTION_FROM = 'from';

  /**
   * The transition direction to.
   */
  const DIRECTION_TO = 'to';

  /**
   * Gets the transition's ID.
   *
   * @return string
   *   The transition's ID.
   */
  public function id();

  /**
   * Gets the transition's label.
   *
   * @return string
   *   The transition's label.
   */
  public function label();

  /**
   * Gets the transition's from states.
   *
   * @return \Drupal\workflows\StateInterface[]
   *   The transition's from states.
   */
  public function from();

  /**
   * Gets the transition's to state.
   *
   * @return \Drupal\workflows\StateInterface
   *   The transition's to state.
   */
  public function to();

  /**
   * Gets the transition's weight.
   *
   * @return string
   *   The transition's weight.
   */
  public function weight();

}